[issue3187] os.listdir can return byte strings

STINNER Victor report at bugs.python.org
Fri Oct 3 13:43:54 CEST 2008


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

> The most generic way of allowing all bytes-alike objects is to write:
>     path = bytes(path)

If you use that, any unicode may fails and the function will always return 
unicode. The goal is to get:
  func(bytes)->bytes
  func(bytearray)->bytes (or maybe bytearray, it doesn't matter)
  func(unicode)->unicode

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


More information about the Python-bugs-list mailing list