MINGW-packages/mingw-w64-python3.13/0078-posixmodule-undefine-HAVE_OPENDIR.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

32 lines
1.3 KiB
Diff

From 31018a14f8749cccc757ff3850c3709255bc891a Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Tue, 20 Jun 2023 18:32:58 +0530
Subject: [PATCH 078/N] 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.
---
Modules/posixmodule.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 1527b80..00eadab 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -397,6 +397,12 @@ corresponding Unix manual entries for more information on calls.");
#elif defined(__MINGW32__) /* GCC for windows hosts */
/* getlogin is detected by configure on mingw-w64 */
# undef HAVE_GETLOGIN
+/* 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. */
+# undef HAVE_OPENDIR
/*# define HAVE_GETCWD 1 - detected by configure*/
# define HAVE_GETPPID 1
# define HAVE_GETLOGIN 1