#7987 Python shebang: Use isolated mode
Opened 2 months ago by cheimes. Modified a month ago

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.

Login to comment on this ticket.

Metadata