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.

classification
Title: os.listdir fails for pathprefix \\?\d:...
Type: Stage:
Components: Windows Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, kruschina
Priority: normal Keywords:

Created on 2004-02-12 09:15 by kruschina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg19972 - (view) Author: Guenter Kruschina (kruschina) Date: 2004-02-12 09:15
The  function os.listdir() fails with arguments
beggining with \\?\... . This is necessary under
windows to switch off pathchecking  for all
Win32-Widecharacter functions. The problem is located
in the posixmodule.

A diff -u will show the solution for this problem:

--- posixmodule.c       2004-01-30 16:51:18.768574400 +0100
+++ posixmodule.c.org   2003-12-03 02:21:01.000000000 +0100
@@ -1386,7 +1386,7 @@
                        len = wcslen(wnamebuf);
                        wch = (len > 0) ?
wnamebuf[len-1] : L'\0';
                        if (wch != L'/' && wch != L'\\'
&& wch != L':')
-                               wnamebuf[len++] = L'\\';
+                               wnamebuf[len++] = L'/';
                        wcscpy(wnamebuf + len, L"*.*");
                        if ((d = PyList_New(0)) == NULL)
                                return NULL;


By the way: The functions isdir..isfile...etc also does
not work with the pathprefix \\?\
msg19973 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-14 09:34
Logged In: YES 
user_id=849994

It seems that someone applied the patch. Closing this
accordingly.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39930
2004-02-12 09:15:12kruschinacreate