summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-07-28 21:23:23 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-07-28 21:23:23 (GMT)
commitd73c1a3009d4bf0212d0d59111c1191066e245e4 (patch)
tree92922c0f8b5e8574753740a12c2aeafca2df3e78 /Lib/os.py
parentaa5b33311acc183db86a178a221d058027648da8 (diff)
downloadcpython-d73c1a3009d4bf0212d0d59111c1191066e245e4.zip
cpython-d73c1a3009d4bf0212d0d59111c1191066e245e4.tar.gz
cpython-d73c1a3009d4bf0212d0d59111c1191066e245e4.tar.bz2
#9283: Fix repr(os.environ), display unicode keys and values on POSIX systems
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/os.py b/Lib/os.py
index e9d44cc6..2f78d8d 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -446,7 +446,9 @@ class _Environ(MutableMapping):
return len(self.data)
def __repr__(self):
- return 'environ({!r})'.format(self.data)
+ return 'environ({})'.format(', '.join(
+ ('{!r}: {!r}'.format(self.decodekey(key), self.decodevalue(value))
+ for key, value in self.data.items())))
def copy(self):
return dict(self)