Skip to content

Commit 3973987

Browse files
naveen521kklazka
authored andcommitted
posixmodule: undefine HAVE_OPENDIR
opendir is detected by configure on mingw-w64, and for some reason things don't work as expected. For example, os.listdir always returns the cwd's directory listing instead of the one specified. By un-defining, this, os.listdir will use the one which uses native windows API.
1 parent 34824c9 commit 3973987

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/posixmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ corresponding Unix manual entries for more information on calls.");
354354
# elif defined(__MINGW32__) /* GCC for windows hosts */
355355
/* getlogin is detected by configure on mingw-w64 */
356356
# undef HAVE_GETLOGIN
357+
/* opendir is detected by configure on mingw-w64, and for some reason
358+
things don't work as expected. For example, os.listdir always returns
359+
the cwd's directory listing instead of the one specified. By
360+
un-defining, this, os.listdir will use the one which uses native
361+
windows API. */
362+
# undef HAVE_OPENDIR
357363
/*# define HAVE_GETCWD 1 - detected by configure*/
358364
# define HAVE_GETPPID 1
359365
# define HAVE_GETLOGIN 1

0 commit comments

Comments
 (0)