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

This commit is contained in:
Victor Stinner 2010-07-28 21:23:23 +00:00
parent aa5b33311a
commit d73c1a3009
1 changed files with 3 additions and 1 deletions

View File

@ -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)