This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients HWJ, amaury.forgeotdarc, benjamin.peterson, dlitz, draghuram, gvanrossum, loewis, pitrou, vstinner, zegreek
Date 2008-09-30.22:02:23
SpamBayes Score 2.0544677e-13
Marked as misclassified No
Message-id <1222812152.26.0.891446512296.issue3187@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2008-09-30 22:02:32vstinnersetrecipients: + vstinner, gvanrossum, loewis, amaury.forgeotdarc, pitrou, draghuram, benjamin.peterson, HWJ, dlitz, zegreek
2008-09-30 22:02:32vstinnersetmessageid: <1222812152.26.0.891446512296.issue3187@psf.upfronthosting.co.za>
2008-09-30 22:02:30vstinnerlinkissue3187 messages
2008-09-30 22:02:30vstinnercreate