STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> Hmm, yes, I see that the open() builtin doesn't accept bytes
> filenames, though os.open() still does.

What? open() builtin, io.open() and os.open() accept bytes filename.

> So what *is* os.listdir() supposed to do when it finds an
> unconvertible filename?  Raise an exception?

os.listdir(str)->str raises an exception on undecodable filename, 
whereas os.listdir(bytes)->bytes doesn't write unicode error because 
the filename is not decoded!

> What if someone puts unconvertible strings in the password database?

Which database? It sounds like a different issue. It's always a good 
thing to reject undecodable string, even with python2 ;-)

----------
nosy: +haypo

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3023>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to