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 sblondon
Recipients andrei.avk, anton.barkovsky, gregory.p.smith, htgoebel, josh.r, kamilturek, methane, pitrou, r.david.murray, rhettinger, sblondon, serhiy.storchaka
Date 2021-08-16.11:51:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629114671.02.0.402850918261.issue15373@roundup.psfhosted.org>
In-reply-to
Content
I think an asdict() method is not necessary. Instanciating a dict from os.environ is enough: 

>>> import os
>>> os.environ
environ({'SHELL': '/bin/bash', ...})
>>> dict(os.environ)
{'SHELL': '/bin/bash', ...})

With 'dict()', it's obvious there is no side effect.


I think os._Environ should not be pickable too because there is an ambiguity too when it will be unpicked: should we set the unpickled data to a basic dict (or another _Environ instance) or to the environment variables?

It seems there are more maintainers in favour of the removal. Removing the copy is a breaking change so it should be done on several releases.

Are you interested by a PR which adds DeprecationWarning when copy.copy(os.environ) or os.environ.copy() are called? It seems to be the first step to implement.
History
Date User Action Args
2021-08-16 11:51:11sblondonsetrecipients: + sblondon, rhettinger, gregory.p.smith, htgoebel, pitrou, r.david.murray, methane, serhiy.storchaka, anton.barkovsky, josh.r, andrei.avk, kamilturek
2021-08-16 11:51:11sblondonsetmessageid: <1629114671.02.0.402850918261.issue15373@roundup.psfhosted.org>
2021-08-16 11:51:11sblondonlinkissue15373 messages
2021-08-16 11:51:10sblondoncreate