This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients ezio.melotti, shura_zam
Date 2010-03-06.15:54:02
SpamBayes Score 4.16498e-08
Marked as misclassified No
Message-id <>
This is a shorter snippet to reproduce the issue:
import os
os.environ['TEST'] = u'äö'.encode('iso-8859-1')

If the var is a non-ASCII byte string, and the string passed to expandvars() is Unicode, the var is decoded implicitly using the ASCII codec and the decoding fails.

On Python 3 the situation looks even worse:
import os
os.environ['TEST'] = 'äö'.encode('iso-8859-1');

This snippet returns "b'\\xe4\\xf6'a".
Date User Action Args
2010-03-06 15:54:05ezio.melottisetrecipients: + ezio.melotti, shura_zam
2010-03-06 15:54:05ezio.melottisetmessageid: <>
2010-03-06 15:54:03ezio.melottilinkissue6815 messages
2010-03-06 15:54:02ezio.melotticreate