]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-37931: Fix crash on OSX re-initializing os.environ (GH-15428)
authorBenoit Hudson <benoit@imgspc.com>
Fri, 6 Dec 2019 19:15:03 +0000 (14:15 -0500)
committerVictor Stinner <vstinner@python.org>
Fri, 6 Dec 2019 19:15:03 +0000 (20:15 +0100)
commit723f71abf7ab0a7be394f9f7b2daa9ecdf6fb1eb
treeab89f9828245437a062c18bd46b04b29cc60a603
parente76ee1a72b9e3f5da287663ea3daec4bb3f67612
bpo-37931: Fix crash on OSX re-initializing os.environ (GH-15428)

On most platforms, the `environ` symbol is accessible everywhere.

In a dylib on OSX, it's not easily accessible, you need to find it with
_NSGetEnviron.

The code was caching the *value* of environ. But a setenv() can change the value,
leaving garbage at the old value. Fix: don't cache the value of environ, just
read it every time.
Misc/ACKS
Misc/NEWS.d/next/macOS/2019-08-23-12-14-34.bpo-37931.goYgQj.rst [new file with mode: 0644]
Modules/posixmodule.c