Message74101
As I wrote, python3_bytes_filename.patch was just an initial support
for bytes filename. So as asked by Guido, here is a new version of my
patch.
Changes:
- for all functions, support bytes as well as bytearray
- os.readlink(unicode) -> unicode and raise an error if unicode
conversion fails. Note: os.readlink(bytes)->bytes was already working.
- many changes in posixpath to fix all functions: add many "if
isinstance(...):" and repeat sep / curdir / parent / ... in bytes
- current version of test_posixpath contains a duplicate to
test_splitdrive() and test_normcase() calls normcase() twice which is
wrong (fixed in my patch)
- i used copy/paste + conversion to bytes to test posixpath with
bytes arguments
- i added some checks in posixpath tests to reject mixing bytes + str
- fix quoting style
- factorize pattern compilation in fnmatch
- fnmatch.fnmatchcase() supports bytes
- fix test_unicode_file: replace getcwdu() by getcwd(), and sometimes
getcwd() by getcwdb()
Open issues:
- pwd.getpwnam() and grp.getgrpnam() should accept bytes, and then
expanduser() should use pwd with bytes. Now expanduser()
supposes that an username is an ASCII string and the user
directory can be converted using getfilesystemencoding()
- expandvars() doesn't support non-ASCII variable value:
that's new problem. os.environ key should be str or bytes?
And the value: str or bytes? It str is choosen, what is the
charset to convert str to bytes? |
|
Date |
User |
Action |
Args |
2008-09-30 22:02:32 | vstinner | set | recipients:
+ vstinner, gvanrossum, loewis, amaury.forgeotdarc, pitrou, draghuram, benjamin.peterson, HWJ, dlitz, zegreek |
2008-09-30 22:02:32 | vstinner | set | messageid: <1222812152.26.0.891446512296.issue3187@psf.upfronthosting.co.za> |
2008-09-30 22:02:30 | vstinner | link | issue3187 messages |
2008-09-30 22:02:30 | vstinner | create | |
|