[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
STINNER Victor added the comment: There is a single test which uses __cleanenv=True: test_hash. The test pass on Windows and this issue is old. I prefer to simplify close it. -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
STINNER Victor added the comment: Serhiy Interesting, how isolation mode works on Windows or if Python is compiled in shared module? Should we keep these environment variables if the __isolated keyword is used? The __isolated parameter of script_helper._assert_python() don't start Python with an empty environment, it only adds -I to the command line. There is a single test which uses __cleanenv=True: test_hash. Arfrever The name of variable is specific to operating system. Ah yes, right. It's probably safe to copy all these environment variables without taking care of the operating system. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
Serhiy Storchaka added the comment: Interesting, how isolation mode works on Windows or if Python is compiled in shared module? Should we keep these environment variables if the __isolated keyword is used? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
Arfrever Frehtes Taifersar Arahesis added the comment: Oh, another problem: if Python is compiled in shared module, libpython3.4.so cannot be found. LD_LIBRARY_PATH must also be copied if __cleanenv=True. Py_ENABLE_SHARED can be checked in sysconfig to decide if the environment variable should be copied or not. The name of variable is specific to operating system. Potentially incomplete list based on value of RUNSHARED variable in configure.ac: AIX: LIBPATH HP-UX:SHLIB_PATH Linux, GNU Hurd, *BSD, SunOS: LD_LIBRARY_PATH Mac OS X (with --enable-shared): DYLD_LIBRARY_PATH Mac OS X (with --disable-shared and --enable-framework): DYLD_FRAMEWORK_PATH -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
New submission from STINNER Victor: On Windows, if Python is started with an empty environment (no environment variable at all), Python fails with: Fatal Python error: Failed to initialize Windows random API (CryptoGen) It's the Windows error 0x80090006 which is not displayed in the error message :-( In fact, it's because Python 3 cannot be started without SYSTEMROOT environment variable. Otherwise, CryptAcquireContext() is unable to find some DLL. IMO the script_helper should be fixed to copy the variable. Recent example of this issue: http://bugs.python.org/issue20599#msg21 -- components: Tests messages: 211138 nosy: brian.curtin, haypo, serhiy.storchaka, tim.golden priority: normal severity: normal status: open title: test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True versions: Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
STINNER Victor added the comment: cleanenv.patch: untested test. -- keywords: +patch Added file: http://bugs.python.org/file34066/cleanenv.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
STINNER Victor added the comment: When Python is executed in an empty environement, not only it displays Fatal Python error: Failed to initialize Windows random API (CryptoGen), but it opens also the fatal error popup on Windows. The issue #19983 proposes a patch to not abort() at exit, but exit with an non-zero exit code instead. The same should be done for this error. By the way, we can maybe help the use to fix this issue with a better error message. For example, add in the message (check if SYSTEMROOT environment variable is correctly set), maybe only if the environment variable is not set. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
STINNER Victor added the comment: Oh, another problem: if Python is compiled in shared module, libpython3.4.so cannot be found. LD_LIBRARY_PATH must also be copied if __cleanenv=True. Py_ENABLE_SHARED can be checked in sysconfig to decide if the environment variable should be copied or not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20614] test.script_helper should copy SYSTEMROOT environment variable for __cleanenv=True
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com