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 vstinner
Date 2008-10-15.00:45:21
SpamBayes Score 3.0125902e-13
Marked as misclassified No
Message-id <1224031525.89.0.11832939128.issue4126@psf.upfronthosting.co.za>
In-reply-to
Content
Python3 skips environment variables which can not be parsed and 
decoded as unicode strings. But exec*() functions keep the original 
environment and so the child process environment is different than the 
Python environement (than os.environ).

I propose to remove these variables to avoid strange behaviours, but 
also to avoid possible security issues.

The attached patch is an implementation of this idea using a custom 
implementation of unsetenv(): _Py_unsetenv() argument is not the name 
of the variable but the raw variable including the value (eg. "a=b"). 
So it's also possible to drop truncated variables like "a" (no value 
nor "=" character).

This issue also affects Python2 since Python2 does also skip variable 
with no value but the variables still exist in memory (and so child 
process get them).
History
Date User Action Args
2008-10-15 00:45:26vstinnersetrecipients: + vstinner
2008-10-15 00:45:25vstinnersetmessageid: <1224031525.89.0.11832939128.issue4126@psf.upfronthosting.co.za>
2008-10-15 00:45:23vstinnerlinkissue4126 messages
2008-10-15 00:45:22vstinnercreate