Message360419
I created bpo-39413 "Implement os.unsetenv() on Windows" to prepare work on this issue. But Eryk raised the same concern about CRT: https://bugs.python.org/issue39413#msg360404
I wasn't aware of that :-/
> `_wputenv` keeps Python's copy of the environment block in sync with CRT's copy, which in turn calls `SetEnvironmentVariableW` to sync with process environment block. The CRT's copy of the environment excludes and disallows variable names that start with "=". Because the interpreter initializes `os.environ` from the CRT environment, Python has never included or allowed 'hidden' variables such as "=C:".
My main motivation to use SetEnvironmentVariableW() on Windows is to avoid bpo-39395. Do you mean that Windows _putenv() is not affected by bpo-39395: Python can safely removes the string to _putenv() just after the call? |
|
Date |
User |
Action |
Args |
2020-01-21 18:08:46 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka, eryksun |
2020-01-21 18:08:46 | vstinner | set | messageid: <1579630126.23.0.178592769359.issue39406@roundup.psfhosted.org> |
2020-01-21 18:08:46 | vstinner | link | issue39406 messages |
2020-01-21 18:08:46 | vstinner | create | |
|