Author serhiy.storchaka
Recipients Arfrever, akira, blueyed, iritkatriel, ned.deily, pefu, serhiy.storchaka, vstinner
Date 2021-09-04.06:55:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630738547.94.0.996794948373.issue20658@roundup.psfhosted.org>
In-reply-to
Content
> For the very specific case of os.environ.clear(), the C function clearenv() could be used if available.

It is bad in any way. The supposed example of using clear():

    old_environ = dict(os.environ)
    os.environ.clear()
    os.environ.update(new_environ)
    ...
    os.environ.clear()
    os.environ.update(old_environ)

Even if clear() passed, it will fail on attempt to restore the old environment, with the empty key.

You can have the same issue in a corresponding C code. I think the only way is to report this as a bug in glibc and wait on their reaction.
History
Date User Action Args
2021-09-04 06:55:47serhiy.storchakasetrecipients: + serhiy.storchaka, pefu, vstinner, blueyed, ned.deily, Arfrever, akira, iritkatriel
2021-09-04 06:55:47serhiy.storchakasetmessageid: <1630738547.94.0.996794948373.issue20658@roundup.psfhosted.org>
2021-09-04 06:55:47serhiy.storchakalinkissue20658 messages
2021-09-04 06:55:47serhiy.storchakacreate