[issue3187] os.listdir can return byte strings

STINNER Victor report at bugs.python.org
Fri Oct 3 12:38:11 CEST 2008


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Le Friday 03 October 2008 03:45:44 Amaury Forgeot d'Arc, vous avez écrit :
> Here is a patch for Windows: (...)
> test_ntpath also runs functions with bytes.

Which charset is used when you use bytes filename? I read somewhere that it's 
the "current codepage". How can the user get this codepage in Python? I ask 
this to complete my document:
  http://wiki.python.org/moin/Python3UnicodeDecodeError

Don't hesitate to edit directly the document, which may also be moved to 
Python3 Doc/ directory.

You should also support bytearray() in ntpath:
   isinstance(path, (bytes, bytearray))

The unit tests might use pure unicode on Windows and bytes on Linux, 
especially getcwd() vs getcwdb().

I don't have Windows nor Mac to test bytes filenames on these systems.

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


More information about the Python-bugs-list mailing list