This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients aidanhs, miss-islington, serhiy.storchaka, vstinner
Date 2018-07-10.22:16:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531260995.15.0.56676864532.issue22689@psf.upfronthosting.co.za>
In-reply-to
Content
>     char *_rtpypath = Py_GETENV("PYTHONPATH"); /* XXX use wide version on Windows */

Python now copies the env var. In master, Modules/main.c:

int res = config_get_env_var_dup(&path, L"PYTHONPATH", "PYTHONPATH");

Moreover, bytes are decoded to Unicode (wchar_t) on UNIX.

This issue is now 4 years old and Serhiy just fixed one issue, so I close the issue.

Even if there is a risk of an issue, nobody came up with a concrete way to trigger a bug, so I don't think that it's a big issue. For example, the reported bug was on Py_GETENV("PYTHONPATH"), whereas this code is critical for Python: if it fails, everybody will complain. Except that since the bug has been reported, nobody ever saw an issue with this code. The code is part of the early code to initialize Python, when there is not possible to execute arbitrary code nor have a second thread, so we should be fine.
History
Date User Action Args
2018-07-10 22:16:35vstinnersetrecipients: + vstinner, serhiy.storchaka, aidanhs, miss-islington
2018-07-10 22:16:35vstinnersetmessageid: <1531260995.15.0.56676864532.issue22689@psf.upfronthosting.co.za>
2018-07-10 22:16:35vstinnerlinkissue22689 messages
2018-07-10 22:16:35vstinnercreate