[pypy-issue] [issue1035] os.listdir(u".") raises UnicodeDecodeError when entries can not be decoded.
Wouter van Heyst
tracker at bugs.pypy.org
Wed Feb 8 10:30:10 CET 2012
New submission from Wouter van Heyst <wouter.pypy at richtlijn.be>:
While working on getting the bzr testsuite running under pypy without any
errors I ran into this behavioural difference with CPython 2.x, originally filed as
https://bugs.launchpad.net/bzr/+bug/927581
To reproduce:
>> LANG=C python -c 'import os; os.mkdir("m\xb5"); os.mkdir("l")'
>> LANG=C python -c 'import os; print os.listdir(u".")'
['m\xb5', u'l']
>> LANG=C pypy -c 'import os; os.listdir(u".")'
Traceback (most recent call last):
File "app_main.py", line 51, in run_toplevel
File "app_main.py", line 534, in run_it
File "<string>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in position 1:
ordinal not in range(128)
http://docs.python.org/library/os.html?highlight=listdir#os.listdir explicitly
mentions that undecodable filenames will be returned as string objects.
----------
messages: 3876
nosy: larstiq, pypy-issue
priority: bug
status: unread
title: os.listdir(u".") raises UnicodeDecodeError when entries can not be decoded.
________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1035>
________________________________________
More information about the pypy-issue
mailing list