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 shura_zam
Recipients ezio.melotti, shura_zam
Date 2009-09-01.08:33:59
SpamBayes Score 2.9827931e-09
Marked as misclassified No
Message-id <1251794041.68.0.442801428154.issue6815@psf.upfronthosting.co.za>
In-reply-to
Content
All code:
[code]
# -*- coding: cp1251 -*-
import os.path

var = r'${APPDATA}\Microsoft\Windows\Start Menu'
print os.path.expandvars(var)
print os.path.expandvars(unicode(var, 'cp1251'))
[/code]
Console session:
[code]
C:\Users\Леново\AppData\Roaming\Microsoft\Windows\Start Menu
Traceback (most recent call last):
  File "C:\Lang\test\python\expandvars_bug.py", line 6, in <module>
    print os.path.expandvars(unicode(var, 'cp1251'))
  File "C:\Lang\Python\26\lib\ntpath.py", line 388, in expandvars
    res = res + c
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 9:
ordinal not in range(128)
[/code]
History
Date User Action Args
2009-09-01 08:34:01shura_zamsetrecipients: + shura_zam, ezio.melotti
2009-09-01 08:34:01shura_zamsetmessageid: <1251794041.68.0.442801428154.issue6815@psf.upfronthosting.co.za>
2009-09-01 08:34:00shura_zamlinkissue6815 messages
2009-09-01 08:33:59shura_zamcreate