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 santoso.wijaya
Recipients brian.curtin, loewis, mandel, pitrou, santoso.wijaya, tim.golden, vstinner
Date 2011-10-24.23:33:13
SpamBayes Score 5.551115e-17
Marked as misclassified No
Message-id <1319499194.97.0.39053741209.issue13234@psf.upfronthosting.co.za>
In-reply-to
Content
I'd also like to point out that Unicode path is handled correctly in both 2.7.x
and 3.x:

    Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
    32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> os.listdir(u'\\\\?\\D:\\Temp\\tempdir')
    [u'sub1', u'test1.txt']
    >>> os.listdir('\\\\?\\D:\\Temp\\tempdir')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    WindowsError: [Error 123] The filename, directory name, or volume label syntax i
    s incorrect: '\\\\?\\D:\\Temp\\tempdir/*.*'

    Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win
    32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> os.listdir('\\\\?\\D:\\Temp\\tempdir')
    ['sub1', 'test1.txt']
    >>> os.listdir(b'\\\\?\\D:\\Temp\\tempdir')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    WindowsError: [Error 123] The filename, directory name, or volume label syntax i
    s incorrect: '\\\\?\\D:\\Temp\\tempdir/*.*'

The problem only lies in the code handling narrow string paths. If you look at
(py33) posixmodule.c:2545-6, the bare path is appended with L"\\*.*". Whereas
in the narrow string case, posixmodule.c:2625-6, the bare path is appended with
"/*.*", instead.

To be consistent, we should use '\\'.
History
Date User Action Args
2011-10-24 23:33:15santoso.wijayasetrecipients: + santoso.wijaya, loewis, pitrou, vstinner, tim.golden, brian.curtin, mandel
2011-10-24 23:33:14santoso.wijayasetmessageid: <1319499194.97.0.39053741209.issue13234@psf.upfronthosting.co.za>
2011-10-24 23:33:14santoso.wijayalinkissue13234 messages
2011-10-24 23:33:14santoso.wijayacreate