diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-23 21:41:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-23 21:41:56 (GMT) |
commit | 13bb71c38f1830f3fabd45b51bb3747aa841b1cb (patch) | |
tree | f904efbb7613223a12088bcd4f85b4f00d64c4bb /Lib/os.py | |
parent | 534db4e19f4d03e4bf85520bd44e0bf90fb38ae3 (diff) | |
download | cpython-13bb71c38f1830f3fabd45b51bb3747aa841b1cb.zip cpython-13bb71c38f1830f3fabd45b51bb3747aa841b1cb.tar.gz cpython-13bb71c38f1830f3fabd45b51bb3747aa841b1cb.tar.bz2 |
Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
bytes strings for environment keys and values
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -450,6 +450,8 @@ environ = _Environ(environ, _keymap, _putenv, _unsetenv) def getenv(key, default=None): """Get an environment variable, return None if it doesn't exist. The optional second argument can specify an alternate default.""" + if isinstance(key, bytes): + key = key.decode(sys.getfilesystemencoding(), "surrogateescape") return environ.get(key, default) __all__.append("getenv") |