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.

classification
Title: buggy repr for os.environ
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vstinner Nosy List: ezio.melotti, pitrou, r.david.murray, vstinner
Priority: high Keywords: patch

Created on 2010-07-17 11:07 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
os_environ_repr.patch vstinner, 2010-07-24 01:34
Messages (4)
msg110547 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-07-17 11:07
os.environ has the same repr as os.environb, that is, it looks as though it's a mapping of bytes to bytes, while it's a mapping of str to str.

>>> repr(os.environ)[:50]
"environ({b'TMP': b'/tmp/', b'XAUTHORITY': b'/var/r"
>>> repr(os.environb)[:50]
"environ({b'TMP': b'/tmp/', b'XAUTHORITY': b'/var/r"
msg110560 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-07-17 14:31
Ezio, it looks like your test for issue 7310 uses exactly the same algorithm as the code itself does, and thus did not detect this breakage.
msg111408 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-07-24 01:34
Patch to fix _Environ.__repr__(), regression introduced by #8603.
msg111849 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-07-28 21:26
Fixed in 3.2 (r83214 + r83215). Other versions are not concerned.
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53529
2010-07-28 21:26:08vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg111849
2010-07-24 01:34:39vstinnersetfiles: + os_environ_repr.patch
keywords: + patch
messages: + msg111408
2010-07-17 14:31:57r.david.murraysetnosy: + ezio.melotti, r.david.murray
messages: + msg110560
2010-07-17 11:07:38pitroucreate