Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions pipcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,8 @@ def openbsd():
def show_system():
'''
Show useful information about the system plus argv and environ.

Omits os.environ if $PIPCL_SHOW_ENV is '0'.
'''
def log(text):
log0(text, caller=3)
Expand Down Expand Up @@ -2447,10 +2449,18 @@ def log(text):
for i, arg in enumerate(sys.argv):
log(f' {i}: {arg!r}')

log(f'os.environ ({len(os.environ)}):')
for k in sorted( os.environ.keys()):
v = os.environ[ k]
log( f' {k}: {v!r}')
PIPCL_SHOW_ENV = os.environ.get('PIPCL_SHOW_ENV')
if PIPCL_SHOW_ENV == '0':
log(f'[Not showing os.environ because {PIPCL_SHOW_ENV=}.]')
else:
log(f'os.environ ({len(os.environ)}):')
for k in sorted( os.environ.keys()):
v = os.environ[ k]
if 'BEGIN OPENSSH PRIVATE KEY' in v:
# Don't show private keys.
log(f' {k} ****')
else:
log( f' {k}: {v!r}')


class PythonFlags:
Expand Down
1 change: 1 addition & 0 deletions scripts/sysinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def run(command, env_extra=None):
'test_textbox3',
'test_3493',
'test_4180',
'test_4767',
)
excluded_tests = ' and not '.join(excluded_tests)
if not pytest_args:
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
Directory containing MuPDF libraries, (libmupdf.so,
libmupdfcpp.so).

PIPCL_SHOW_ENV
If '0', we do not show environment variables on startup.

PYMUPDF_SETUP_DEVENV
Location of devenv.com on Windows. If unset we search for it - see
wdev.py. if that fails we use just 'devenv.com'.
Expand Down
4 changes: 4 additions & 0 deletions tests/test_4767.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def test_4767():
'''
Check handling of unsafe paths in `pymupdf embed-extract`.
'''
if os.environ.get('PYODIDE_ROOT'):
print('test_4767(): not running on Pyodide - cannot run child processes.')
return

with pymupdf.open() as document:
document.new_page()
document.embfile_add(
Expand Down