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 Arfrever, akira, blueyed, iritkatriel, ned.deily, pefu, serhiy.storchaka, vstinner
Date 2021-09-04.11:19:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630754371.06.0.550484720021.issue20658@roundup.psfhosted.org>
In-reply-to
Content
POSIX says:

(1) "The setenv() function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character."

https://pubs.opengroup.org/onlinepubs/009604499/functions/setenv.html

(2) "The unsetenv() function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character."

https://pubs.opengroup.org/onlinepubs/009695399/functions/unsetenv.html

But POSIX doesn't specify which keys are invalid for putenv. It only specifies a single error:

(3) "The putenv() function may fail if: [ENOMEM] Insufficient memory was available."

https://pubs.opengroup.org/onlinepubs/009696899/functions/putenv.html

The GNU libc respects POSIX.

IMO setenv() and unsetenv() are fine. The problem comes from putenv() which is under specified and allows keys which are causing a lot of subtle issues, not only in Python.
History
Date User Action Args
2021-09-04 11:19:31vstinnersetrecipients: + vstinner, pefu, blueyed, ned.deily, Arfrever, akira, serhiy.storchaka, iritkatriel
2021-09-04 11:19:31vstinnersetmessageid: <1630754371.06.0.550484720021.issue20658@roundup.psfhosted.org>
2021-09-04 11:19:31vstinnerlinkissue20658 messages
2021-09-04 11:19:30vstinnercreate