[issue39395] The os module should unset() environment variable at exit

2020-01-24 Thread Eric Snow
Eric Snow added the comment: FTR, #39376 is related (avoid the process-global env vars in the first place). -- nosy: +eric.snow ___ Python tracker ___

[issue39395] The os module should unset() environment variable at exit

2020-01-24 Thread STINNER Victor
STINNER Victor added the comment: On non-Windows platforms, Python now requires setenv() and unsetenv() functions to build. setenv() and unsetenv() should be available on all platforms supported by Python. If it's not the case, someone can maintain a downstream patch which is a revert of

[issue39395] The os module should unset() environment variable at exit

2020-01-24 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39395] The os module should unset() environment variable at exit

2020-01-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset b8d1262e8afe7b907b4a394a191739571092acdb by Victor Stinner in branch 'master': bpo-39395: putenv() and unsetenv() always available (GH-18135) https://github.com/python/cpython/commit/b8d1262e8afe7b907b4a394a191739571092acdb --

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread STINNER Victor
STINNER Victor added the comment: Clearing environment variables at exit has a drawback: it changes the behavior in code executed after Python finalization (Py_FinalizeEx() call). It may cause regression. So I proposed PR 18135 to fix this issue differently: on non-Windows platforms,

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17521 pull_request: https://github.com/python/cpython/pull/18135 ___ Python tracker ___

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread STINNER Victor
STINNER Victor added the comment: I closed bpo-39406: os.putenv() is now implemented with setenv() if available. The internal putenv_dict is no longer used on Windows and if setenv() is available. Now only non-Windows platforms without setenv() are affected by this issue. --

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread STINNER Victor
STINNER Victor added the comment: > Issue39406 is a new feature. In any case we should fix potential crash in > older Python versions. Python 3.8 and older are not affected by this issue since they never destroy the posix_putenv_garbage dictionary: memory is never released. --

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread STINNER Victor
Change by STINNER Victor : -- versions: -Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue39406 is a new feature. In any case we should fix potential crash in older Python versions. -- nosy: +serhiy.storchaka ___ Python tracker

[issue39395] The os module should unset() environment variable at exit

2020-01-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- type: -> crash versions: +Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue39395] The os module should unset() environment variable at exit

2020-01-21 Thread STINNER Victor
STINNER Victor added the comment: I proposed bpo-39406 which avoids to have to clear environment variables set by Python at exit on platforms providing setenv(). -- ___ Python tracker

[issue39395] The os module should unset() environment variable at exit

2020-01-21 Thread STINNER Victor
STINNER Victor added the comment: Fedora downstream issue, crash in the "elements" package: https://bugzilla.redhat.com/show_bug.cgi?id=1791761 -- ___ Python tracker ___

[issue39395] The os module should unset() environment variable at exit

2020-01-20 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +17471 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18078 ___ Python tracker ___

[issue39395] The os module should unset() environment variable at exit

2020-01-20 Thread STINNER Victor
New submission from STINNER Victor : os.environ[key] = value has to keep internally the string "key=value\0" after putenv("key=value\0") has been called, since the glibc doesn't copy the string. Python has to manage the string memory. Internally, the posix module uses a