[New-bugs-announce] [issue17702] os.environ converts key type from string to bytes in KeyError exception

Robert Tasarz report at bugs.python.org
Fri Apr 12 02:36:11 CEST 2013


New submission from Robert Tasarz:

Minimal example:

>>> import os
>>> somekey = 'random'
>>> try:
...   os.environ[somekey]
... except KeyError as e:
...   print(repr(e))
...   somekey == e.args[0]
... 
KeyError(b'random',)
False

Tested in Python 3.3.1 on Debian

----------
components: Extension Modules
messages: 186604
nosy: Robert.Tasarz
priority: normal
severity: normal
status: open
title: os.environ converts key type from string to bytes in KeyError exception
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17702>
_______________________________________


More information about the New-bugs-announce mailing list