#7987 Python shebang: Use isolated mode
Closed: fixed 3 months ago by rcritten. Opened 6 months ago by cheimes.

IPA's Python scripts use the shebang #!/usr/bin/python3 -E. The option -E makes Python ignore all env vars starting with PYTHON. Since Python 3.4, the Python interpreter has an additional argument to isolate scripts from the user environment. The -I option includes -E (ignore envs), -s (ignore user site packages), and does not add current script dir to sys.path. Since master/4.8 supports only Python >= 3.6, we should use -I everywhere.

https://docs.python.org/3/using/cmdline.html#cmdoption-e
https://docs.python.org/3/using/cmdline.html#id2


Hello everyone, I took the liberty to work on this issue and made a PR on github

https://github.com/freeipa/freeipa/pull/3416

Hope everything its fine, I am testing the scripts but seems everything is OK until now.

master:

  • a38a384 ipa-scripts: fix all ipa command line scripts to operate with -I

ipa-4-8:

  • f3814e6 ipa-scripts: fix all ipa command line scripts to operate with -I

Metadata Update from @rcritten:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 months ago

Login to comment on this ticket.

Metadata