[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: No problems noted with a quick test of posixpath_darwin.patch on 10.6 so looks good. Ok thanks. Fix commited to 3.2 (r84866) and 2.7 (r84868). I kept my patch on macpath (supports_unicode_filenames=True) because it is still valid (even if it is not used). Or is it wrong that Mac OS 9 speaks unicode? -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Ned Deily n...@acm.org added the comment: No problems noted with a quick test of posixpath_darwin.patch on 10.6 so looks good. It will get regression tested on more configurations sometime later. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18841/test_pep277.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: r84784 sets os.path.supports_unicode_filenames to True on Mac OS X (macpath module). About test_supports_unicode_filenames.patch. test_unicode_listdir() is wrong: os.listdir(str) always return str (see r84701). verify that the new file's name is equal to the name we tried check of test_unicode_filename() is also wrong: newfile.name is always equal to fname, it doesn't depend on support_unicode_filenames. Since the test is wrong, I don't want to commit it. test_pep277 is enough to test the creation of files with unicode names. I don't see anything else to do now, so I close this issue. Reopen it if I forgot something, or open a new issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: I backported r84701 and r84784 to Python 2.7 (r84787). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Ned Deily n...@acm.org added the comment: There seems to be some confusion about the macpath.py module. I'm not sure why it even exists in Python 3. Note it has to do with obsolete Classic MacOS-style paths (colon-separated paths) which are available on Mac OS X only through deprecated Carbon interfaces. I'm not even sure that those style paths do support unicode. More importantly, the underlying Carbon interfaces that macpath.py uses were removed for Python 3. AFAIK, virtually nothing on OS X uses these style paths anymore and, with the removal of all the old Mac Carbon support in Python 3, I don't think there is any Python module that can use these paths other than macpath. I think this module should be marked for deprecation and removed. There is no reason to modify it nor add a NEWS note, even for 2.7. -- nosy: +ned.deily, ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Martin v. Löwis mar...@v.loewis.de added the comment: About Windows: supports_unicode_filenames is False if sys.getwindowsversion().platform 2: win32s (0) or Windows 9x/ME (1). I don't know win32s, but I know that Windows 9x/ME is not more supported. Win32s is long gone. It was an emulation layer to support Win32 on Windows 3.1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Martin v. Löwis mar...@v.loewis.de added the comment: I think that supports_unicode_filenames is still useful to check if the filesystem API uses bytes (Linux, FreeBSD, Solaris, ...) or characters (Mac OS X, Windows). Mac OS X is a special case because the C API uses char* (byte string), but the filesystem encoding is fixed to utf-8 and it doesn't accept invalid utf-8 filenames. So I would like to say that supports_unicode_filenames should be True on Mac OS X (which was the initial request). Sounds reasonable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: test_pep277.patch removes the usage of os.path.supports_unicode_filenames from test_pep277: the test still pass on Debian Sid (Linux). Can someone test the patch on Mac OS X, FreeBSD and Solaris (and maybe other POSIX/UNIX OSes)? About Windows: supports_unicode_filenames is False if sys.getwindowsversion().platform 2: win32s (0) or Windows 9x/ME (1). I don't know win32s, but I know that Windows 9x/ME is not more supported. -- Added file: http://bugs.python.org/file18841/test_pep277.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: Oops, forget test_pep277.patch: I misunderstood r81149 (new way to detect if the filesystem supports unicode or not). test_pep277 fails with my patch on Linux with LC_CTYPE=C. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: r84701 fixes supports_unicode_filenames's definition in Python 3.2 (and r84702 in Python 3.1): os.listdir(str) now always return unicode filenames (including non-ascii characters). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
STINNER Victor victor.stin...@haypocalc.com added the comment: Maybe os.path.supports_unicode_filenames should be deprecated. The doc currently says: True if arbitrary Unicode strings can be used as file names (within limitations imposed by the file system), and if os.listdir() returns Unicode strings for a Unicode argument. On Linux both the things work, even if the value of os.path.supports_unicode_filenames is still False: (...) It depends on the locale encoding: $ LC_CTYPE=C ./python Python 3.2a2+ (py3k, Sep 11 2010, 01:48:43) import sys; sys.getfilesystemencoding() 'ascii' open('\xe9', 'w').close() ... UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 0: ordinal not in range(128) With utf-8, surrogates are forbidden. Eg. $ ./python Python 3.2a2+ (py3k, Sep 11 2010, 01:48:43) import sys; sys.getfilesystemencoding() 'utf-8' open('\uDC00', 'w').close() ... UnicodeEncodeError: 'utf-8' codec can't encode character '\udc00' in position 0: surrogates not allowed On Windows, Python uses the unicode API and so the unicode support doesn't depend on the locale encoding (on the ansi code page). Surrogates are accepted on Windows: '\uDC00' is a valid filename. I think that supports_unicode_filenames is still useful to check if the filesystem API uses bytes (Linux, FreeBSD, Solaris, ...) or characters (Mac OS X, Windows). Mac OS X is a special case because the C API uses char* (byte string), but the filesystem encoding is fixed to utf-8 and it doesn't accept invalid utf-8 filenames. So I would like to say that supports_unicode_filenames should be True on Mac OS X (which was the initial request). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Mark Lawrence breamore...@yahoo.co.uk added the comment: There are at least three messages stating that os.path.supports_unicode_filenames should go so can someone please provide a definitive statement regarding its future. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Éric Araujo mer...@netwok.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Florent Xicluna florent.xicl...@gmail.com: Removed file: http://bugs.python.org/file15842/issue767645_test_pep277.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Florent Xicluna florent.xicl...@gmail.com added the comment: With r78594, test_pep277 is active on all platforms having Unicode-friendly filesystem encoding. -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Florent Xicluna la...@yahoo.fr: -- components: +Tests stage: - patch review versions: +Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Brett Cannon br...@python.org: -- nosy: -brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Ezio Melotti ezio.melo...@gmail.com added the comment: Maybe os.path.supports_unicode_filenames should be deprecated. The doc currently says: True if arbitrary Unicode strings can be used as file names (within limitations imposed by the file system), and if os.listdir() returns Unicode strings for a Unicode argument. On Linux both the things work, even if the value of os.path.supports_unicode_filenames is still False: os.path.supports_unicode_filenames False open(u'fòòbàr', 'w') open file u'f\xf2\xf2b\xe0r', mode 'w' at 0x9470778 os.listdir(u'.') [u'f\xf2\xf2b\xe0r', ...] open(u'fòòbàr') open file u'f\xf2\xf2b\xe0r', mode 'r' at 0x9470778 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
R. David Murray rdmur...@bitdance.com added the comment: In addition, whether or not true unicode filenames are supported really depends, at least on Linux, on the *filesystem*, not on the OS (for some definition of support). In other words, I think os.path.supports_unicode_filenames is an API design that is broken and should probably be dropped. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Florent Xicluna la...@yahoo.fr added the comment: Additionally it filters out test_pep277 on some platforms. But seemingly, it is not needed anymore with this patch. -- nosy: +flox resolution: later - Added file: http://bugs.python.org/file15842/issue767645_test_pep277.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Joe Amenta ament...@msu.edu added the comment: If it is decided to keep supports_unicode_filenames, here is a patch for test_os.py that verifies the value of supports_unicode_filenames against the following line from the documentation: True if arbitrary Unicode strings can be used as file names (within limitations imposed by the file system), and if os.listdir() returns Unicode strings for a Unicode argument. -- keywords: +patch nosy: +joe.amenta Added file: http://bugs.python.org/file15843/test_supports_unicode_filenames.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue767645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue767645] incorrect os.path.supports_unicode_filenames
Changes by Christian Heimes: -- priority: normal - low versions: +Python 2.6 -Python 2.3 Tracker [EMAIL PROTECTED] http://bugs.python.org/issue767645 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com