[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Ezio Melotti
Ezio Melotti added the comment: > It is normal behavior for Windows. Try it with the 'dir' command > in a command window. (That said, I have no idea, not being a > Windows user, how Windows decides what the 'current' directory > is on any given drive from any given context). Yes, I tried to r

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Committed in r72273(trunk) and r72274(py3k). -- resolution: accepted -> fixed status: open -> closed ___ Python tracker ___ _

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Martin v. Löwis
Martin v. Löwis added the comment: Hirokazu, the patch looks fine, please apply to 2.7 and 3k. I wouldn't backport it to 2.6/3.0, since it may break existing code. -- assignee: -> ocean-city resolution: -> accepted ___ Python tracker

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: For u"", os.listdir calls FindFirstFileW with u"\\*.*", For "", os.listdir calls FindFirstFileA with "*.*". The code before FindFirstFile[AW] is slightly different for empty path. -- ___ Python tracker

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I hope attached patch works. >>> import os >>> os.listdir("") Traceback (most recent call last): File "", line 1, in WindowsError: [Error 3] 指定されたパスが見つかりません。: '' [36200 refs] >>> os.listdir(u"") Traceback (most recent call last): File "", line 1, in Wi

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread R. David Murray
R. David Murray added the comment: On Sun, 3 May 2009 at 17:36, Antoine Pitrou wrote: > As for the "C:" behaviour, I think it is normal: you are not specifying > the path itself, only the drive letter, so it uses the current path in > the specified drive (which /is/ cwd if you are already runnin

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Martin v. Löwis
Martin v. Löwis added the comment: Before anything is changed, I would first like to understand where the difference comes from. If it gives ENOENT on Unix, it should also give ENOENT on Windows (rather than giving ValueError). In addition, it should also give what open("")/open(b"") gives - as

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: As for the "C:" behaviour, I think it is normal: you are not specifying the path itself, only the drive letter, so it uses the current path in the specified drive (which /is/ cwd if you are already running from C:, but may be something else if running from anoth

[issue5913] On Windows os.listdir('') -> cwd and os.listdir(u'') -> C:\

2009-05-03 Thread Ezio Melotti
New submission from Ezio Melotti : On Windows, with Python2/Python3, os.listdir('')/os.listdir(b'') list the content of the current working directory and os.listdir(u'')/os.listdir('') the content of C:\. On Linux the error "OSError: [Errno 2] No such file or directory: ''" is raised. I also no