On 12:47 am, [EMAIL PROTECTED] wrote:
This is the most sane contribution I've seen so far :).
See attached patch: python3_bytes_filename.patch
Using the patch, you will get:
- open() support bytes
- listdir(unicode) -> only unicode, *skip* invalid filenames
(as asked by Guido)
Forgive me for being a bit dense, but I couldn't find this hunk in the
patch. Do I understand properly that (listdir(bytes) -> bytes)?
If so, this seems basically sane to me, since it provides text behavior
where possible and allows more sophisticated filesystem wrappers (i.e.
Twisted's FilePath, Will McGugan's "FS") to do more tricky things,
separating filenames for display to the user and filenames for exchange
with the FS.
- remove os.getcwdu()
- create os.getcwdb() -> bytes
- glob.glob() support bytes
- fnmatch.filter() support bytes
- posixpath.join() and posixpath.split() support bytes
It sounds like maybe there should be some 2to3 fixers in here somewhere,
too? Not necessarily as part of this patch, but somewhere related? I
don't know what they would do, but it does seem quite likely that code
which was previously correct under 2.6 (using bytes) would suddenly be
mixing bytes and unicode with these APIs.
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com