Message74059
| Author |
vstinner |
| Recipients |
HWJ, amaury.forgeotdarc, benjamin.peterson, dlitz, draghuram, gvanrossum, loewis, pitrou, vstinner, zegreek |
| Date |
2008年09月30日.01:08:08 |
| SpamBayes Score |
3.3392094e-09 |
| Marked as misclassified |
No |
| Message-id |
<1222736891.79.0.535221009659.issue3187@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Patch python3_bytes_filename.patch:
- open() support bytes
- listdir(unicode) -> only unicode, *skip* invalid filenames
(as asked by Guido)
- remove os.getcwdu()
- create os.getcwdb() -> bytes
- glob.glob() support bytes
- fnmatch.filter() support bytes
- posixpath.join() and posixpath.split() support bytes
Mixing bytes and str is invalid. Examples raising a TypeError:
- posixpath.join(b'x', 'y')
- fnmatch.filter([b'x', 'y'], '*')
- fnmatch.filter([b'x', b'y'], '*')
- glob.glob1('.', b'*')
- glob.glob1(b'.', '*')
TODO:
- review this patch :-)
- support non-ASCII bytes in fnmatch.filter()
- fix other functions, eg. posixpath.isabs() and
fnmatch.fnmatchcase()
- fix functions written in C: grep FileSystemDefaultEncoding
- make sure that mixing bytes and str is rejected |
|