[New-bugs-announce] [issue6815] UnicodeDecodeError in os.path.expandvars

Alexandr Zamaraev report at bugs.python.org
Tue Sep 1 09:51:17 CEST 2009


New submission from Alexandr Zamaraev <shura_zam at users.sourceforge.net>:

OS Windows Vista Home Basic Ru + sp2
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on win32

Simple code to crach (file expandvars_bug.py):
[code]
# -*- coding: cp1251 -*-
import os.path

var = r'C:\Вася\Microsoft'
print os.path.expandvars(var)
print os.path.expandvars(unicode(var))
[/code]
Console session:
[code]
C:\┬рё \Microsoft
Traceback (most recent call last):
  File "C:\Lang\test\python\expandvars_bug.py", line 6, in <module>
    print os.path.expandvars(unicode(var))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3:
ordinal
not in range(128)
[/code]

----------
components: Unicode
messages: 92124
nosy: shura_zam
severity: normal
status: open
title: UnicodeDecodeError in os.path.expandvars
type: crash
versions: Python 2.6

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


More information about the New-bugs-announce mailing list