Commit d73c1a30 authored by Victor Stinner's avatar Victor Stinner

#9283: Fix repr(os.environ), display unicode keys and values on POSIX systems

parent aa5b3331
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment