diff options
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -443,6 +443,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") |