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 mkatsev
Recipients andrei.avk, gregory.p.smith, htgoebel, josh.r, kamilturek, methane, mkatsev, pitrou, r.david.murray, rhettinger, rmast, sblondon, serhiy.storchaka
Date 2022-03-01.23:26:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646177200.52.0.365293824195.issue15373@roundup.psfhosted.org>
In-reply-to
Content
Note that deepcopy doesn't work either, even though it looks like it does at the first glance (which is arguably worse since it's harder to notice):

Python 3.8.6 (default, Jun  4 2021, 05:16:01)
>>> import copy, os, subprocess
>>> env_copy = copy.deepcopy(os.environ)
>>> env_copy["TEST"] = "oh no"
>>> os.environ["TEST"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/fbcode/platform009/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'TEST'
>>> subprocess.run("echo $TEST", shell=True, capture_output=True).stdout.decode()
'oh no\n'
History
Date User Action Args
2022-03-01 23:26:40mkatsevsetrecipients: + mkatsev, rhettinger, gregory.p.smith, htgoebel, pitrou, r.david.murray, methane, serhiy.storchaka, josh.r, sblondon, andrei.avk, kamilturek, rmast
2022-03-01 23:26:40mkatsevsetmessageid: <1646177200.52.0.365293824195.issue15373@roundup.psfhosted.org>
2022-03-01 23:26:40mkatsevlinkissue15373 messages
2022-03-01 23:26:40mkatsevcreate