[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-10 Thread STINNER Victor
STINNER Victor added the comment: > 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(, L"PYTHONPATH", "PYTHONPATH"); Moreover, bytes are decoded to Unicode

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-09 Thread miss-islington
miss-islington added the comment: New changeset 6f4fbf8ea428e13959a7aaba0ac9725ed407752a by Miss Islington (bot) in branch '3.7': bpo-22689: Copy the result of getenv() in sys_breakpointhook(). (GH-8194) https://github.com/python/cpython/commit/6f4fbf8ea428e13959a7aaba0ac9725ed407752a

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +7755 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f60bf0e168255b7675a4c049250ba6b202f8e647 by Serhiy Storchaka in branch 'master': bpo-22689: Copy the result of getenv() in sys_breakpointhook(). (GH-8194) https://github.com/python/cpython/commit/f60bf0e168255b7675a4c049250ba6b202f8e647

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +7746 stage: -> patch review ___ Python tracker ___ ___

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2014-10-21 Thread Aidan Hobson Sayers
New submission from Aidan Hobson Sayers: Posix says the following on the subject of getenv: The returned string pointer might be invalidated or the string content might be overwritten by a subsequent call to getenv() (http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html)

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2014-10-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo versions: -Python 3.2, Python 3.3, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22689 ___

[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2014-10-21 Thread Aidan Hobson Sayers
Aidan Hobson Sayers added the comment: In case it matters, I'm compiling using Emscripten which implements getenv like so: https://github.com/kripken/emscripten/blob/1.25.2/src/library.js#L3323 (I personally think it's a bizarre way to do it, but technically I think it's ok?) --