version_3_9_14_win :
{
compil_script : "Python-3.9.bat"
- patches : []
+ patches : ['python-3.9.14.001-ctype-init.patch',
+ 'python-3.9.14.02-os.py.patch',
+ 'python-3.9.14.03-getpath.patch',
+ 'python-3.9.14.04-dynload_win.patch'
+ ]
build_depend : ['perl']
}
-
--- /dev/null
+--- Python-3.9.14-ref/Lib/ctypes/__init__.py 2022-09-06 19:26:16.000000000 +0200
++++ Python-3.9.14-new/Lib/ctypes/__init__.py 2024-04-03 17:34:16.000000000 +0200
+@@ -364,7 +364,14 @@
+ if '/' in name or '\\' in name:
+ self._name = nt._getfullpathname(self._name)
+ mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
+-
++ # PATH is how DLL lookup has always worked in the past
++ # in Python on Windows. IMHO both the above mode flags
++ # are not wanted and cause many serious regressions within
++ # the conda ecosystem on Windows. We should however
++ # propagate any PATH changes that have happened to Python
++ # library and that is not yet implemented.
++ LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008
++ mode = LOAD_WITH_ALTERED_SEARCH_PATH
+ class _FuncPtr(_CFuncPtr):
+ _flags_ = flags
+ _restype_ = self._func_restype_
--- /dev/null
+--- Python-3.9.14-ref/Lib/os.py 2022-09-06 19:26:16.000000000 +0200
++++ Python-3.9.14-new/Lib/os.py 2024-04-03 16:58:24.000000000 +0200
+@@ -1107,6 +1107,8 @@
+ Remove the directory by calling close() on the returned object or
+ using it in a with statement.
+ """
++ #FIXME SALOME
++ return
+ import nt
+ cookie = nt._add_dll_directory(path)
+ return _AddedDllDirectory(
--- /dev/null
+--- Python-3.9.14-ref/PC/getpathp.c 2022-09-06 19:26:16.000000000 +0200
++++ Python-3.9.14-new/PC/getpathp.c 2024-04-03 17:13:22.000000000 +0200
+@@ -1116,7 +1116,7 @@
+ if (!get_dllpath(py3path)) {
+ reduce(py3path);
+ join(py3path, PY3_DLLNAME);
+- hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
++ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (hPython3 != NULL) {
+ return 1;
+ }
+@@ -1124,7 +1124,7 @@
+
+ /* If we can locate python3.dll in our application dir,
+ use that DLL */
+- hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR);
++ hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (hPython3 != NULL) {
+ return 1;
+ }
+@@ -1134,7 +1134,7 @@
+ wcscpy(py3path, Py_GetPrefix());
+ if (py3path[0]) {
+ join(py3path, L"DLLs\\" PY3_DLLNAME);
+- hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
++ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ }
+ return hPython3 != NULL;
+ }
--- /dev/null
+--- Python-3.9.14-ref/Python/dynload_win.c 2022-09-06 19:26:16.000000000 +0200
++++ Python-3.9.14-new/Python/dynload_win.c 2024-04-03 17:08:02.000000000 +0200
+@@ -191,9 +191,7 @@
+ AddDllDirectory function. We add SEARCH_DLL_LOAD_DIR to
+ ensure DLLs adjacent to the PYD are preferred. */
+ Py_BEGIN_ALLOW_THREADS
+- hDLL = LoadLibraryExW(wpathname, NULL,
+- LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
+- LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
++ hDLL = LoadLibraryExW(wpathname, NULL,LOAD_WITH_ALTERED_SEARCH_PATH);
+ Py_END_ALLOW_THREADS
+
+ /* restore old error mode settings */