summaryrefslogtreecommitdiff
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2018-01-15 13:39:04 -0800
committerSerhiy Storchaka <storchaka@gmail.com>2018-01-15 23:39:04 +0200
commit27f32e938ff51fd5d90a29abbbabc6b81d156f33 (patch)
tree4f119ab169d8ce36474fd1e877553a8395704329 /Modules/posixmodule.c
parentab95b3074ee43098edf3f23b07fb18ef57ee614d (diff)
downloadcpython-git-27f32e938ff51fd5d90a29abbbabc6b81d156f33.tar.gz
bpo-32539: Fix OSError for os.listdir() for extended-length paths on Windows (#5169)
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath Paths that begin with `\\?\` are "extended-length paths".
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c9886d514b..cecbb45fb4 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2385,7 +2385,7 @@ posix_listdir(PyObject *self, PyObject *args)
if (len > 0) {
char ch = namebuf[len-1];
if (ch != SEP && ch != ALTSEP && ch != ':')
- namebuf[len++] = '/';
+ namebuf[len++] = SEP;
strcpy(namebuf + len, "*.*");
}