public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Sandro Mani <manisandro@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mingw-python3] rawhide: Update to 3.14.7
Date: Wed, 23 Sep 2026 16:12:22 GMT	[thread overview]
Message-ID: <179017994285.1.3033290796824066764.rpms-mingw-python3-60d707afd579@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/mingw-python3
Branch : rawhide
Commit : 60d707afd5797ccbf360cb9eb351834b4caeccf2
Author : Sandro Mani <manisandro@gmail.com>
Date   : 2026-09-23T18:11:53+02:00
Stats  : +5486/-2033 in 124 file(s)
URL    : https://src.fedoraproject.org/rpms/mingw-python3/c/60d707afd5797ccbf360cb9eb351834b4caeccf2?branch=rawhide

Log:
Update to 3.14.7

---
diff --git a/.gitignore b/.gitignore
index 8df5e10..4a01999 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,3 +47,4 @@
 /Python-3.11.14.tar.xz
 /Python-3.11.15.tar.xz
 /Python-3.11.16.tar.xz
+/Python-3.14.7.tar.xz

diff --git a/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch b/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch
new file mode 100644
index 0000000..c8cae58
--- /dev/null
+++ b/0001-build-add-with-nt-threads-and-make-it-default-on-min.patch
@@ -0,0 +1,265 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:29.999970298 +0200
+@@ -2903,6 +2903,53 @@ then
+ 	BASECFLAGS="$BASECFLAGS $ac_arch_flags"
+ fi
+ 
++dnl NOTE:
++dnl - GCC 4.4+ for mingw* require and use posix threads(pthreads-w32)
++dnl - Host may contain installed pthreads-w32.
++dnl - On windows platform only NT-thread model is supported. 
++dnl To avoid miss detection scipt first will check for NT-thread model
++dnl and if is not found will try to detect build options for pthread
++dnl model. Autodetection could be overiden if variable with_nt_threads
++dnl is set in "Site Configuration" (see autoconf manual).
++dnl If NT-thread model is enabled script skips some checks that
++dnl impact build process. When a new functionality is added, developers
++dnl are responsible to update configure script to avoid thread models
++dnl to be mixed.
++
++AC_MSG_CHECKING([for --with-nt-threads])
++AC_ARG_WITH(nt-threads,
++            AS_HELP_STRING([--with-nt-threads], [build with windows threads (default is system-dependent)]),
++[
++	case $withval in
++	no)	with_nt_threads=no;;
++	yes)	with_nt_threads=yes;;
++	*)	with_nt_threads=yes;;
++	esac
++], [
++	case $host in
++		*-*-mingw*) with_nt_threads=yes;;
++		*) with_nt_threads=no;;
++	esac
++])
++AC_MSG_RESULT([$with_nt_threads])
++
++if test $with_nt_threads = yes ; then
++AC_MSG_CHECKING([whether linking with nt-threads work])
++AC_LINK_IFELSE([
++    AC_LANG_PROGRAM([[#include <process.h>]],[[_beginthread(0, 0, 0);]])
++  ],
++  [AC_MSG_RESULT([yes])],
++  [AC_MSG_ERROR([failed to link with nt-threads])])
++fi
++
++if test $with_nt_threads = yes ; then
++  dnl temporary default flag to avoid additional pthread checks
++  dnl and initilize other ac..thread flags to no
++  ac_cv_pthread_is_default=no
++  ac_cv_kthread=no
++  ac_cv_pthread=no
++  dnl ac_cv_kpthread is set to no if default is yes (see below)
++else
+ # On some compilers, pthreads are available without further options
+ # (e.g. MacOS X). On some of these systems, the compiler will not
+ # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
+@@ -3014,6 +3061,8 @@ int main(void){
+ CC="$ac_save_cc"])
+ fi
+ 
++fi
++
+ # If we have set a CC compiler flag for thread support then
+ # check if it works for CXX, too.
+ if test ! -z "$CXX"
+@@ -3033,6 +3082,10 @@ elif test "$ac_cv_pthread" = "yes"
+ then
+   CXX="$CXX -pthread"
+   ac_cv_cxx_thread=yes
++elif test "$with_nt_threads" = "yes"
++then
++  dnl set to always to skip extra pthread check below
++  ac_cv_cxx_thread=always
+ else
+   ac_cv_cxx_thread=no
+ fi
+@@ -3074,8 +3127,8 @@ AC_CHECK_HEADERS([ \
+   alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
+   io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
+   linux/netfilter_ipv4.h linux/random.h linux/soundcard.h linux/sched.h \
+-  linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
+-  sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
++  linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pty.h \
++  setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
+   sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \
+   sys/loadavg.h sys/lock.h sys/memfd.h sys/mkdev.h sys/mman.h sys/modem.h sys/param.h sys/pidfd.h sys/poll.h \
+   sys/random.h sys/resource.h sys/select.h sys/sendfile.h sys/socket.h sys/soundcard.h sys/stat.h \
+@@ -3087,6 +3140,14 @@ AC_CHECK_HEADERS([ \
+ AC_HEADER_DIRENT
+ AC_HEADER_MAJOR
+ 
++# If using nt threads, don't look for pthread.h or thread.h
++if test "x$with_nt_threads" = xno ; then
++AC_HEADER_STDC
++AC_CHECK_HEADERS(pthread.h sched.h thread.h)
++AC_HEADER_DIRENT
++AC_HEADER_MAJOR
++fi
++
+ # bluetooth/bluetooth.h has been known to not compile with -std=c99.
+ # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
+ SAVE_CFLAGS=$CFLAGS
+@@ -3290,6 +3351,10 @@ elif test "$ac_cv_pthread" = "yes"
+ then CC="$CC -pthread"
+ fi
+ 
++if test $with_nt_threads = yes ; then
++  dnl skip check for pthread_t if NT-thread model is enabled
++  ac_cv_have_pthread_t=skip
++else
+ AC_CACHE_CHECK([for pthread_t], [ac_cv_have_pthread_t], [
+ AC_COMPILE_IFELSE([
+   AC_LANG_PROGRAM([[@%:@include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]])
+@@ -3321,7 +3386,7 @@ AS_VAR_IF([ac_cv_pthread_key_t_is_arithm
+     AC_DEFINE([PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT], [1],
+               [Define if pthread_key_t is compatible with int.])
+ ])
+-
++fi
+ CC="$ac_save_cc"
+ 
+ AC_MSG_CHECKING([for --enable-framework])
+@@ -3966,10 +4031,15 @@ then
+   fi
+ fi
+ 
++if test $with_nt_threads = yes ; then
++  dnl do not search for sem_init if NT-thread model is enabled
++  :
++else
+ # 'Real Time' functions on Solaris
+ # posix4 on Solaris 2.6
+ # pthread (first!) on Linux
+ AC_SEARCH_LIBS([sem_init], [pthread rt posix4])
++fi
+ 
+ # check if we need libintl for locale functions
+ AC_CHECK_LIB([intl], [textdomain],
+@@ -4737,6 +4807,11 @@ then
+         CXX="$CXX -pthread"
+     fi
+     posix_threads=yes
++elif test $with_nt_threads = yes
++then
++    posix_threads=no
++    AC_DEFINE(NT_THREADS, 1,
++        [Define to 1 if you want to use native NT threads])
+ else
+     if test ! -z "$withval" -a -d "$withval"
+     then LDFLAGS="$LDFLAGS -L$withval"
+@@ -5318,6 +5393,15 @@ if test "$ac_sys_system" = "Linux-androi
+ fi
+ 
+ # checks for library functions
++if test $with_nt_threads = yes ; then
++  dnl GCC(mingw) 4.4+ require and use posix threads(pthreads-w32)
++  dnl and host may contain installed pthreads-w32.
++  dnl Skip checks for some functions declared in pthreads-w32 if
++  dnl NT-thread model is enabled.
++  ac_cv_func_pthread_kill=skip
++  ac_cv_func_sem_open=skip
++  ac_cv_func_sched_setscheduler=skip
++fi
+ AC_CHECK_FUNCS([ \
+   accept4 alarm bind_textdomain_codeset chmod chown clock closefrom close_range confstr \
+   copy_file_range ctermid dladdr dup execv explicit_bzero explicit_memset \
+@@ -6254,6 +6338,10 @@ dnl actually works.  For FreeBSD version
+ dnl the kernel module that provides POSIX semaphores
+ dnl isn't loaded by default, so an attempt to call
+ dnl sem_open results in a 'Signal 12' error.
++if test $with_nt_threads = yes ; then
++  dnl skip posix semaphores test if NT-thread model is enabled
++  ac_cv_posix_semaphores_enabled=no
++fi
+ AC_CACHE_CHECK([whether POSIX semaphores are enabled], [ac_cv_posix_semaphores_enabled],
+   AC_RUN_IFELSE([
+     AC_LANG_SOURCE([
+@@ -6287,6 +6375,14 @@ AS_VAR_IF([ac_cv_posix_semaphores_enable
+ ])
+ 
+ dnl Multiprocessing check for broken sem_getvalue
++if test $with_nt_threads = yes ; then
++  dnl Skip test if NT-thread model is enabled.
++  dnl NOTE the test case below fail for pthreads-w32 as:
++  dnl - SEM_FAILED is not defined;
++  dnl - sem_open is a stub;
++  dnl - sem_getvalue work(!).
++  ac_cv_broken_sem_getvalue=skip
++fi
+ AC_CACHE_CHECK([for broken sem_getvalue], [ac_cv_broken_sem_getvalue],
+   AC_RUN_IFELSE([
+     AC_LANG_SOURCE([
+diff -rupN --no-dereference Python-3.14.7/Include/internal/pycore_condvar.h Python-3.14.7-new/Include/internal/pycore_condvar.h
+--- Python-3.14.7/Include/internal/pycore_condvar.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/internal/pycore_condvar.h	2026-09-22 09:06:29.998794507 +0200
+@@ -35,6 +35,10 @@
+ #  define WIN32_LEAN_AND_MEAN
+ #endif
+ #include <windows.h>              // CRITICAL_SECTION
++/* winpthreads are involved via windows header, so need undef _POSIX_THREADS after header include */
++#if defined(_POSIX_THREADS)
++#undef _POSIX_THREADS
++#endif
+ 
+ /* options */
+ /* emulated condition variables are provided for those that want
+diff -rupN --no-dereference Python-3.14.7/Include/internal/pycore_pythread.h Python-3.14.7-new/Include/internal/pycore_pythread.h
+--- Python-3.14.7/Include/internal/pycore_pythread.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/internal/pycore_pythread.h	2026-09-22 09:06:29.999033953 +0200
+@@ -16,6 +16,12 @@ extern "C" {
+                             && !defined(_POSIX_SEMAPHORES))
+ #  include <unistd.h>             // _POSIX_THREADS, _POSIX_SEMAPHORES
+ #endif
++#ifdef __MINGW32__
++# if !defined(HAVE_PTHREAD_H) || defined(NT_THREADS)
++#  undef _POSIX_THREADS
++# endif
++#endif
++
+ #if (defined(HAVE_PTHREAD_H) && !defined(_POSIX_THREADS) \
+                              && !defined(_POSIX_SEMAPHORES))
+    // This means pthreads are not implemented in libc headers, hence the macro
+diff -rupN --no-dereference Python-3.14.7/Include/pythread.h Python-3.14.7-new/Include/pythread.h
+--- Python-3.14.7/Include/pythread.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/pythread.h	2026-09-22 09:06:29.999218223 +0200
+@@ -7,6 +7,12 @@ typedef void *PyThread_type_lock;
+ extern "C" {
+ #endif
+ 
++#ifdef __MINGW32__
++# if !defined(HAVE_PTHREAD_H) || defined(NT_THREADS)
++#  undef _POSIX_THREADS
++# endif
++#endif
++
+ /* Return status codes for Python lock acquisition.  Chosen for maximum
+  * backwards compatibility, ie failure -> 0, success -> 1.  */
+ typedef enum PyLockStatus {
+diff -rupN --no-dereference Python-3.14.7/Modules/_multiprocessing/multiprocessing.h Python-3.14.7-new/Modules/_multiprocessing/multiprocessing.h
+--- Python-3.14.7/Modules/_multiprocessing/multiprocessing.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_multiprocessing/multiprocessing.h	2026-09-22 09:06:29.999456630 +0200
+@@ -31,6 +31,9 @@
+ #  define SEM_HANDLE HANDLE
+ #  define SEM_VALUE_MAX LONG_MAX
+ #  define HAVE_MP_SEMAPHORE
++#  if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS)
++#    include <semaphore.h>
++#  endif
+ #else
+ #  include <fcntl.h>                 /* O_CREAT and O_EXCL */
+ #  if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
+diff -rupN --no-dereference Python-3.14.7/pyconfig.h.in Python-3.14.7-new/pyconfig.h.in
+--- Python-3.14.7/pyconfig.h.in	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/pyconfig.h.in	2026-09-22 09:06:30.000833293 +0200
+@@ -1693,6 +1693,9 @@
+ /* Define if mvwdelch in curses.h is an expression. */
+ #undef MVWDELCH_IS_EXPRESSION
+ 
++/* Define to 1 if you want to use native NT threads */
++#undef NT_THREADS
++
+ /* Define to the address where bug reports for this package should be sent. */
+ #undef PACKAGE_BUGREPORT
+ 

diff --git a/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch b/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch
new file mode 100644
index 0000000..1dcf4bc
--- /dev/null
+++ b/0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch
@@ -0,0 +1,48 @@
+diff -rupN --no-dereference Python-3.14.7/Include/pyport.h Python-3.14.7-new/Include/pyport.h
+--- Python-3.14.7/Include/pyport.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/pyport.h	2026-09-22 09:06:30.309957518 +0200
+@@ -78,6 +78,44 @@
+ #endif
+ 
+ 
++#ifdef __MINGW32__
++/* Translate GCC[mingw*] platform specific defines to those
++ * used in python code.
++ */
++#if !defined(MS_WIN64) && defined(_WIN64)
++#  define MS_WIN64
++#endif
++#if !defined(MS_WIN32) && defined(_WIN32)
++#  define MS_WIN32
++#endif
++#if !defined(MS_WINDOWS) && defined(MS_WIN32)
++#  define MS_WINDOWS
++#endif
++
++#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) || defined(Py_BUILD_CORE_MODULE)
++#include <winapifamily.h>
++
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
++#define MS_WINDOWS_DESKTOP
++#endif
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
++#define MS_WINDOWS_APP
++#endif
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM)
++#define MS_WINDOWS_SYSTEM
++#endif
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES)
++#define MS_WINDOWS_GAMES
++#endif
++
++/* Define to 1 if you support windows console io */
++#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
++#define HAVE_WINDOWS_CONSOLE_IO 1
++#endif
++#endif /* Py_BUILD_CORE || Py_BUILD_CORE_BUILTIN || Py_BUILD_CORE_MODULE */
++
++#endif /* __MINGW32__*/
++
+ /**************************************************************************
+ Symbols and macros to supply platform-independent interfaces to basic
+ C language & library operations whose spellings vary across platforms.

diff --git a/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch b/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch
new file mode 100644
index 0000000..396a603
--- /dev/null
+++ b/0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch
@@ -0,0 +1,53 @@
+diff -rupN --no-dereference Python-3.14.7/Python/sysmodule.c Python-3.14.7-new/Python/sysmodule.c
+--- Python-3.14.7/Python/sysmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/sysmodule.c	2026-09-22 09:06:30.602952860 +0200
+@@ -166,6 +166,38 @@ PySys_GetObject(const char *name)
+ }
+ 
+ static int
++use_alt_sep(void)
++{
++#ifdef MS_WINDOWS
++    char* msystem = getenv("MSYSTEM");
++    if (msystem != NULL && strcmp(msystem, "") != 0) {
++        return 1;
++    }
++#endif
++    return 0;
++}
++
++static int
++is_mingw(void)
++{
++#ifdef __MINGW32__
++    return 1;
++#else
++    return 0;
++#endif
++}
++
++static int
++is_mingw_ucrt(void)
++{
++#if defined(__MINGW32__) && defined(_UCRT)
++    return 1;
++#else
++    return 0;
++#endif
++}
++
++static int
+ sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v)
+ {
+     if (key == NULL) {
+@@ -3889,6 +3921,10 @@ _PySys_InitCore(PyThreadState *tstate, P
+     SET_SYS_FROM_STRING("byteorder", "little");
+ #endif
+ 
++    SET_SYS("_is_mingw", PyLong_FromLong(is_mingw()));
++    SET_SYS("_is_mingw_ucrt", PyLong_FromLong(is_mingw_ucrt()));
++    SET_SYS("_use_alt_sep", PyLong_FromLong(use_alt_sep()));
++
+ #ifdef MS_COREDLL
+     SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule));
+     SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString);

diff --git a/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch b/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch
new file mode 100644
index 0000000..7f2c779
--- /dev/null
+++ b/0004-configure-add-MACHDEP-and-platform-on-MINGW.patch
@@ -0,0 +1,31 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:30.302773824 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:30.891911527 +0200
+@@ -327,6 +327,9 @@ then
+ 	*-*-cygwin*)
+ 		ac_sys_system=Cygwin
+ 		;;
++	*-*-mingw*)
++		ac_sys_system=MINGW
++		;;
+ 	*-apple-ios*)
+ 		ac_sys_system=iOS
+ 		;;
+@@ -370,6 +373,7 @@ then
+ 	linux*) MACHDEP="linux";;
+ 	cygwin*) MACHDEP="cygwin";;
+ 	darwin*) MACHDEP="darwin";;
++	mingw*) MACHDEP="win32";;
+ 	'')	MACHDEP="unknown";;
+     esac
+ 
+@@ -812,6 +816,9 @@ if test "$cross_compiling" = yes; then
+ 	wasm32-*-* | wasm64-*-*)
+ 		_host_ident=$host_cpu
+ 		;;
++	*-*-mingw*)
++		_host_cpu=
++		;;
+ 	*)
+ 		# for now, limit cross builds to known configurations
+ 		MACHDEP="unknown"

diff --git a/0005-build-Add-default-cross-configuration-for-MINGW.patch b/0005-build-Add-default-cross-configuration-for-MINGW.patch
new file mode 100644
index 0000000..d4372f2
--- /dev/null
+++ b/0005-build-Add-default-cross-configuration-for-MINGW.patch
@@ -0,0 +1,67 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:31.188843828 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:31.194103474 +0200
+@@ -1270,6 +1270,28 @@ AC_CACHE_CHECK([for -Wl,--no-as-needed],
+ ])
+ AC_SUBST([NO_AS_NEEDED])
+ 
++# initialize default configuration
++py_config=
++case $host in
++  *-*-mingw*) py_config=mingw ;;
++esac
++if test -n "$py_config" ; then
++  AC_MSG_NOTICE([loading configure defaults from .../Misc/config_$py_config"])
++  . "$srcdir/Misc/config_$py_config"
++fi
++
++# initialize defaults for cross-builds
++if test "$cross_compiling" = yes; then
++  py_config=$host_os
++  case $py_config in
++    mingw32*) py_config=mingw32 ;;
++  esac
++  if test -f "$srcdir/Misc/cross_$py_config" ; then
++    AC_MSG_NOTICE([loading cross defaults from .../Misc/cross_$py_config"])
++    . "$srcdir/Misc/cross_$py_config"
++  fi
++fi
++
+ AC_MSG_CHECKING([for the Android API level])
+ cat > conftest.c <<EOF
+ #ifdef __ANDROID__
+diff -rupN --no-dereference Python-3.14.7/Misc/config_mingw Python-3.14.7-new/Misc/config_mingw
+--- Python-3.14.7/Misc/config_mingw	1970-01-01 01:00:00.000000000 +0100
++++ Python-3.14.7-new/Misc/config_mingw	2026-09-22 09:06:31.193483446 +0200
+@@ -0,0 +1,15 @@
++# configure defaults for mingw* hosts
++
++# mingw functions to ignore
++ac_cv_func_ftruncate=ignore	# implement it as _chsize
++
++# mingw-w64 functions to ignore
++ac_cv_func_truncate=ignore
++ac_cv_func_alarm=ignore
++
++# files to ignore
++ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist
++ac_cv_file__dev_ptc=no
++
++# force detection of winsock2 functionality - require wxp or newer
++ac_cv_func_getpeername=yes
+\ No newline at end of file
+diff -rupN --no-dereference Python-3.14.7/Misc/cross_mingw32 Python-3.14.7-new/Misc/cross_mingw32
+--- Python-3.14.7/Misc/cross_mingw32	1970-01-01 01:00:00.000000000 +0100
++++ Python-3.14.7-new/Misc/cross_mingw32	2026-09-22 09:06:31.193576524 +0200
+@@ -0,0 +1,11 @@
++# configure defaults for mingw32 host if cross-build
++
++ac_cv_little_endian_double=yes
++ac_cv_big_endian_double=no
++ac_cv_mixed_endian_double=no
++
++ac_cv_tanh_preserves_zero_sign=yes
++
++ac_cv_wchar_t_signed=no
++
++ac_cv_have_size_t_format=no

diff --git a/0006-configure-enable-largefile-support-by-default-for-Mi.patch b/0006-configure-enable-largefile-support-by-default-for-Mi.patch
new file mode 100644
index 0000000..a0e117a
--- /dev/null
+++ b/0006-configure-enable-largefile-support-by-default-for-Mi.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:31.483691475 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:31.488691126 +0200
+@@ -3350,6 +3350,10 @@ if test "$ac_cv_sizeof_off_t" -gt "$ac_c
+ else
+   have_largefile_support="no"
+ fi
++dnl Activate on windows platforms (32&64-bit) where off_t(4) < fpos_t(8)
++AS_CASE([$ac_sys_system],
++  [MINGW], [have_largefile_support="yes"]
++)
+ AS_VAR_IF([have_largefile_support], [yes], [
+   AC_DEFINE([HAVE_LARGEFILE_SUPPORT], [1],
+   [Defined to enable large file support when an off_t is bigger than a long

diff --git a/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch b/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch
new file mode 100644
index 0000000..c26ec21
--- /dev/null
+++ b/0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch
@@ -0,0 +1,32 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:31.779670835 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:31.784670486 +0200
+@@ -7449,6 +7449,16 @@ do
+   THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
+ done
+ 
++case $host in
++  *-*-mingw*)
++    dnl Required for windows builds as Objects/exceptions.c require
++    dnl "errmap.h" from $srcdir/PC.
++    dnl Note we cannot use BASECPPFLAGS as autogenerated pyconfig.h
++    dnl has to be before customized located in ../PC.
++    CPPFLAGS="-I\$(srcdir)/PC $CPPFLAGS"
++    ;;
++esac
++
+ AC_SUBST([SRCDIRS])
+ SRCDIRS="\
+   Modules \
+@@ -7476,6 +7486,11 @@ SRCDIRS="\
+   Programs \
+   Python \
+   Python/frozen_modules"
++
++case $host in
++  *-*-mingw*) SRCDIRS="$SRCDIRS PC";;
++esac
++
+ AC_MSG_CHECKING([for build directories])
+ for dir in $SRCDIRS; do
+     if test ! -d $dir; then

diff --git a/0008-build-add-MINGW-support-for-posixmodule.patch b/0008-build-add-MINGW-support-for-posixmodule.patch
new file mode 100644
index 0000000..e29cd16
--- /dev/null
+++ b/0008-build-add-MINGW-support-for-posixmodule.patch
@@ -0,0 +1,78 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:32.070650544 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:32.079291232 +0200
+@@ -943,6 +943,14 @@ then
+             [Define to include mbstate_t for mbrtowc])
+ fi
+ 
++AC_MSG_CHECKING([for posixmodule name])
++AC_SUBST(MODULE_POSIXMODULE_NAME)
++case $host in
++  *-*-mingw*)	MODULE_POSIXMODULE_NAME=nt;;
++  *)		MODULE_POSIXMODULE_NAME=posix;;
++esac
++AC_MSG_RESULT([$MODULE_POSIXMODULE_NAME])
++
+ # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
+ # it may influence the way we can build extensions, so distutils
+ # needs to check it
+diff -rupN --no-dereference Python-3.14.7/Modules/posixmodule.c Python-3.14.7-new/Modules/posixmodule.c
+--- Python-3.14.7/Modules/posixmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/posixmodule.c	2026-09-22 09:06:32.077650056 +0200
+@@ -296,6 +296,32 @@
+ #  define HAVE_PIPE       1
+ #  define HAVE_FSYNC      1
+ #  define fsync _commit
++#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
++#  define HAVE_SPAWNV     1
++#  define HAVE_WSPAWNV    1
++#  define HAVE_WEXECV     1
++/*#    define HAVE_EXECV	     1 - detected by configure*/
++#  define HAVE_PIPE	     1
++#  define HAVE_POPEN	     1
++#  define HAVE_SYSTEM	   1
++#  define HAVE_CWAIT      1
++#  define HAVE_FSYNC      1
++#  define fsync _commit
++#  include <winioctl.h>
++#  ifndef _MAX_ENV
++#    define _MAX_ENV	32767
++#  endif
+ #endif
+ 
+ 
+@@ -1745,9 +1771,9 @@ error:
+ */
+ #include <crt_externs.h>
+ #define USE_DARWIN_NS_GET_ENVIRON 1
+-#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
++#elif !defined(MS_WINDOWS) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
+ extern char **environ;
+-#endif /* !_MSC_VER */
++#endif /* !MS_WINDOWS */
+ 
+ static PyObject *
+ convertenviron(void)
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.bootstrap.in Python-3.14.7-new/Modules/Setup.bootstrap.in
+--- Python-3.14.7/Modules/Setup.bootstrap.in	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/Setup.bootstrap.in	2026-09-22 09:06:32.076402859 +0200
+@@ -8,7 +8,7 @@
+ # module C APIs are used in core
+ atexit atexitmodule.c
+ faulthandler faulthandler.c
+-posix posixmodule.c
++@MODULE_POSIXMODULE_NAME@ posixmodule.c
+ _signal signalmodule.c
+ _tracemalloc _tracemalloc.c
+ _suggestions _suggestions.c

diff --git a/0009-exports.h-Add-support-for-MINGW.patch b/0009-exports.h-Add-support-for-MINGW.patch
new file mode 100644
index 0000000..f60cf35
--- /dev/null
+++ b/0009-exports.h-Add-support-for-MINGW.patch
@@ -0,0 +1,49 @@
+diff -rupN --no-dereference Python-3.14.7/Include/exports.h Python-3.14.7-new/Include/exports.h
+--- Python-3.14.7/Include/exports.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/exports.h	2026-09-22 09:06:32.378280912 +0200
+@@ -15,12 +15,12 @@
+ */
+ 
+ /*
+-  All windows ports, except cygwin, are handled in PC/pyconfig.h.
++  Only MSVC windows ports is handled in PC/pyconfig.h.
+ 
+-  Cygwin is the only other autoconf platform requiring special
++  Cygwin and Mingw is the only other autoconf platform requiring special
+   linkage handling and it uses __declspec().
+ */
+-#if defined(__CYGWIN__)
++#if defined(__CYGWIN__) || defined(__MINGW32__)
+ #       define HAVE_DECLSPEC_DLL
+ #endif
+ 
+@@ -60,21 +60,23 @@
+ #                       define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
+ #                       define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
+         /* module init functions inside the core need no external linkage */
+-        /* except for Cygwin to handle embedding */
+-#                       if defined(__CYGWIN__)
++        /* except for Cygwin/Mingw to handle embedding */
++#                       if defined(__CYGWIN__) || defined(__MINGW32__)
+ #                               define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
+-#                       else /* __CYGWIN__ */
++#                       else /* __CYGWIN__ || __MINGW32__*/
+ #                               define PyMODINIT_FUNC PyObject*
+-#                       endif /* __CYGWIN__ */
++#                       endif /* __CYGWIN__ || __MINGW32__*/
+ #               else /* Py_BUILD_CORE */
+         /* Building an extension module, or an embedded situation */
+         /* public Python functions and data are imported */
+         /* Under Cygwin, auto-import functions to prevent compilation */
+         /* failures similar to those described at the bottom of 4.1: */
+         /* http://docs.python.org/extending/windows.html#a-cookbook-approach */
+-#                       if !defined(__CYGWIN__)
++#                       if defined(__CYGWIN__) || defined(__MINGW32__)
++#                               define PyAPI_FUNC(RTYPE) RTYPE
++#                       else
+ #                               define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE
+-#                       endif /* !__CYGWIN__ */
++#                       endif /* __CYGWIN__ || __MINGW32__*/
+ #                       define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
+         /* module init functions outside the core must be exported */
+ #                       if defined(__cplusplus)

diff --git a/0010-configure-add-options-so-that-shared-build-is-possib.patch b/0010-configure-add-options-so-that-shared-build-is-possib.patch
new file mode 100644
index 0000000..1c448dd
--- /dev/null
+++ b/0010-configure-add-options-so-that-shared-build-is-possib.patch
@@ -0,0 +1,61 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:32.369629694 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:32.664609124 +0200
+@@ -1604,6 +1604,11 @@ if test $enable_shared = "yes"; then
+       BLDLIBRARY='-L. -lpython$(LDVERSION)'
+       DLLLIBRARY='libpython$(LDVERSION).dll'
+       ;;
++    MINGW*)
++      LDLIBRARY='libpython$(LDVERSION).dll.a'
++      DLLLIBRARY='libpython$(LDVERSION).dll'
++      BLDLIBRARY='-L. -lpython$(LDVERSION)'
++      ;;
+     SunOS*)
+       LDLIBRARY='libpython$(LDVERSION).so'
+       BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
+@@ -1663,6 +1668,9 @@ else # shared is disabled
+       BLDLIBRARY='$(LIBRARY)'
+       LDLIBRARY='libpython$(LDVERSION).dll.a'
+       ;;
++    MINGW*)
++      LDLIBRARY='libpython$(LDVERSION).a'
++      ;;
+   esac
+ fi
+ AC_MSG_RESULT([$LDLIBRARY])
+@@ -3716,6 +3724,10 @@ then
+ 	CYGWIN*)
+ 		LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+ 		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
++	MINGW*)
++		LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base'
++		LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base'
++		;;
+ 	*)	LDSHARED="ld";;
+ 	esac
+ fi
+@@ -6603,7 +6615,7 @@ LIBPYTHON=''
+ # LIBPYTHON is used by python-config, python3.pc, the commands for building the
+ # stdlib's own extension modules, and external package build systems via
+ # sysconfig, so its value must be suitable for all those contexts.
+-if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then
++if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin" || test "$MACHDEP" = "win32"); then
+   MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)"
+   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
+ fi
+@@ -7507,6 +7519,15 @@ for dir in $SRCDIRS; do
+ done
+ AC_MSG_RESULT([done])
+ 
++# For mingw build need additional library for linking
++case $host in
++  *-*-mingw*)
++    LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt"
++  ;;
++  *)
++  ;;
++esac
++
+ # Availability of -O2:
+ AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [
+ saved_cflags="$CFLAGS"

diff --git a/0011-build-Add-PYD_PLATFORM_TAG.patch b/0011-build-Add-PYD_PLATFORM_TAG.patch
new file mode 100644
index 0000000..084b63b
--- /dev/null
+++ b/0011-build-Add-PYD_PLATFORM_TAG.patch
@@ -0,0 +1,76 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:32.954588902 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:32.960925836 +0200
+@@ -6562,6 +6562,61 @@ esac
+ # check for endianness
+ AC_C_BIGENDIAN
+ 
++AC_SUBST(PYD_PLATFORM_TAG)
++# Special case of PYD_PLATFORM_TAG with python build with mingw.
++# Python can with different cpu arch and c runtime as well as different
++# toolchain. We follow this`mingw_<cpu_arch>_<c_runtime>_<toolchain>`
++# convention for PYD_PLATFORM_TAG. Where:
++# `cpu_arch` = `x86_64`, `aarch64` or `i686`
++# `c_runtime` = `msvcrt` or `ucrt`
++# `toolchain` = `gnu` or `llvm`
++PYD_PLATFORM_TAG=""
++case $host in
++  *-*-mingw*)
++    # check if we are linking to ucrt
++    AC_MSG_CHECKING(whether linking to ucrt)
++    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
++    #include <stdio.h>
++    #ifndef _UCRT
++        #error no ucrt
++    #endif
++    int main(){ return 0; }
++    ]])],[linking_to_ucrt=yes],[linking_to_ucrt=no])
++    AC_MSG_RESULT($linking_to_ucrt)
++    ;;
++esac
++case $host_os in
++    mingw*)
++  AC_MSG_CHECKING(PYD_PLATFORM_TAG)
++  PYD_PLATFORM_TAG="mingw"
++  case $host in
++  i686-*-mingw*)
++    PYD_PLATFORM_TAG+="_i686"
++    ;;
++  x86_64-*-mingw*)
++    PYD_PLATFORM_TAG+="_x86_64"
++    ;;
++  aarch64-*-mingw*)
++    PYD_PLATFORM_TAG+="_aarch64"
++    ;;
++  armv7-*-mingw*)
++    PYD_PLATFORM_TAG+="_armv7"
++    ;;
++  esac
++  if test $linking_to_ucrt = no; then
++    PYD_PLATFORM_TAG+="_msvcrt"
++  else
++    PYD_PLATFORM_TAG+="_ucrt"
++  fi
++  if test "$ac_cv_cc_name" = "clang"; then
++    # it is CLANG32
++    PYD_PLATFORM_TAG+="_llvm"
++  else
++    PYD_PLATFORM_TAG+="_gnu"
++  fi
++  AC_MSG_RESULT($PYD_PLATFORM_TAG)
++esac
++
+ # ABI version string for Python extension modules.  This appears between the
+ # periods in shared library file names, e.g. foo.<SOABI>.so.  It is calculated
+ # from the following attributes which affect the ABI of this Python build (in
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:32.960092663 +0200
+@@ -175,6 +175,7 @@ CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$
+ # Symbols used for using shared libraries
+ SHLIB_SUFFIX=	@SHLIB_SUFFIX@
+ EXT_SUFFIX=	@EXT_SUFFIX@
++PYD_PLATFORM_TAG = @PYD_PLATFORM_TAG@
+ LDSHARED=	@LDSHARED@ $(PY_LDFLAGS)
+ BLDSHARED=	@BLDSHARED@ $(PY_CORE_LDFLAGS)
+ LDCXXSHARED=	@LDCXXSHARED@ $(PY_LDFLAGS)

diff --git a/0012-build-Add-dynload_win-support-for-MinGW.patch b/0012-build-Add-dynload_win-support-for-MinGW.patch
new file mode 100644
index 0000000..cd2da7c
--- /dev/null
+++ b/0012-build-Add-dynload_win-support-for-MinGW.patch
@@ -0,0 +1,32 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:33.243123095 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:33.249142530 +0200
+@@ -5397,6 +5397,12 @@ then
+ 	fi
+ 	;;
+ 	esac
++	case $host in
++	*-*-mingw*)
++    DYNLOADFILE="dynload_win.o"
++    extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o"
++    ;;
++	esac
+ fi
+ AC_MSG_RESULT([$DYNLOADFILE])
+ if test "$DYNLOADFILE" != "dynload_stub.o"
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:33.244121714 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:33.247568471 +0200
+@@ -1971,6 +1971,12 @@ Python/dynload_hpux.o: $(srcdir)/Python/
+ 		-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
+ 		-o $@ $(srcdir)/Python/dynload_hpux.c
+ 
++Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile
++	$(CC) -c $(PY_CORE_CFLAGS) \
++		-DPYD_PLATFORM_TAG='"$(PYD_PLATFORM_TAG)"' \
++		-DPY3_DLLNAME='L"$(DLLLIBRARY)"' \
++		-o $@ $(srcdir)/Python/dynload_win.c
++
+ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
+ 		-DABIFLAGS='"$(ABIFLAGS)"' \

diff --git a/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch b/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch
new file mode 100644
index 0000000..d6fd9b8
--- /dev/null
+++ b/0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch
@@ -0,0 +1,27 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:33.545547691 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:33.552658933 +0200
+@@ -3590,6 +3590,9 @@ if test -z "$SHLIB_SUFFIX"; then
+ 	CYGWIN*)   SHLIB_SUFFIX=.dll;;
+ 	*)	   SHLIB_SUFFIX=.so;;
+ 	esac
++	case $host_os in
++	mingw*)    SHLIB_SUFFIX=.pyd;;
++	esac
+ fi
+ AC_MSG_RESULT([$SHLIB_SUFFIX])
+ 
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:33.547752321 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:33.551820501 +0200
+@@ -2947,8 +2947,8 @@ libainstall: all scripts
+ 	@if test "$(STATIC_LIBPYTHON)" = 1; then \
+ 		if test -d $(LIBRARY); then :; else \
+ 			if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-				if test "$(SHLIB_SUFFIX)" = .dll; then \
+-					$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
++				if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \
++					$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
+ 				else \
+ 					$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+ 				fi; \

diff --git a/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch b/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch
new file mode 100644
index 0000000..d084ee0
--- /dev/null
+++ b/0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch
@@ -0,0 +1,41 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:33.837173524 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:33.841527051 +0200
+@@ -6646,7 +6646,10 @@ AC_SUBST([SOABI])
+ AC_MSG_CHECKING([ABIFLAGS])
+ AC_MSG_RESULT([$ABIFLAGS])
+ AC_MSG_CHECKING([SOABI])
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM}
++case $host_os in
++    mingw*) SOABI='cp'`echo $VERSION | tr -d .`${ABI_THREAD}-${PYD_PLATFORM_TAG};;
++    *) SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM};;
++esac
+ AC_MSG_RESULT([$SOABI])
+ 
+ # Release build, debug build (Py_DEBUG), and trace refs build (Py_TRACE_REFS)
+@@ -6654,13 +6657,23 @@ AC_MSG_RESULT([$SOABI])
+ if test "$Py_DEBUG" = 'true'; then
+   # Similar to SOABI but remove "d" flag from ABIFLAGS
+   AC_SUBST([ALT_SOABI])
+-  ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_PLATFORM}
++  case $host_os in
++      mingw*) ALT_SOABI='cp'`echo $VERSION | tr -d .`${ABI_THREAD}-${PYD_PLATFORM_TAG};;
++      *) ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_PLATFORM};;
++  esac
+   AC_DEFINE_UNQUOTED([ALT_SOABI], ["${ALT_SOABI}"],
+             [Alternative SOABI used in debug build to load C extensions built in release mode])
+ fi
+ 
+ AC_SUBST([EXT_SUFFIX])
+-EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX}
++PYD_DEBUG_SUFFIX=""
++if test "$Py_DEBUG" = "true"; then
++  PYD_DEBUG_SUFFIX="_d"
++fi
++case $host_os in
++    mingw*) EXT_SUFFIX=${PYD_DEBUG_SUFFIX}.${SOABI}${SHLIB_SUFFIX};;
++    *) EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
++esac
+ 
+ AC_MSG_CHECKING([LDVERSION])
+ LDVERSION='$(VERSION)$(ABIFLAGS)'

diff --git a/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch b/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch
new file mode 100644
index 0000000..1472071
--- /dev/null
+++ b/0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch
@@ -0,0 +1,30 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:34.143196165 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:34.148166533 +0200
+@@ -5414,6 +5414,26 @@ then
+         [Defined when any dynamic module loading is enabled.])
+ fi
+ 
++# MS_DLL_ID is used for sys.winver and Windows registry keys.
++case $host in
++*-*-mingw*)
++	case $host in
++	i686*)
++		CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-32\"'"
++		;;
++	armv7*)
++		CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm32\"'"
++		;;
++	aarch64*)
++		CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"${VERSION}-arm64\"'"
++		;;
++	*)
++		CFLAGS_NODIST="$CFLAGS_NODIST -DMS_DLL_ID='\"$VERSION\"'"
++		;;
++	esac
++	;;
++esac
++
+ # MACHDEP_OBJS can be set to platform-specific object files needed by Python
+ 
+ AC_SUBST([MACHDEP_OBJS])

diff --git a/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch b/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch
new file mode 100644
index 0000000..0fe93d4
--- /dev/null
+++ b/0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch
@@ -0,0 +1,32 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:34.434485699 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:34.441497918 +0200
+@@ -7576,6 +7576,16 @@ case $host in
+     ;;
+ esac
+ 
++dnl Python interpreter main program for frozen scripts
++AC_SUBST(PYTHON_OBJS_FROZENMAIN)
++PYTHON_OBJS_FROZENMAIN="Python/frozenmain.o"
++case $host in
++  *-*-mingw*)
++    dnl 'PC/frozen_dllmain.c' - not yet
++    PYTHON_OBJS_FROZENMAIN=
++    ;;
++esac
++
+ AC_SUBST([SRCDIRS])
+ SRCDIRS="\
+   Modules \
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:33.838244619 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:34.439485351 +0200
+@@ -445,7 +445,7 @@ PYTHON_OBJS=	\
+ 		Python/errors.o \
+ 		Python/flowgraph.o \
+ 		Python/frame.o \
+-		Python/frozenmain.o \
++		@PYTHON_OBJS_FROZENMAIN@ \
+ 		Python/future.o \
+ 		Python/gc.o \
+ 		Python/gc_free_threading.o \

diff --git a/0017-socketmodule-add-MINGW-support.patch b/0017-socketmodule-add-MINGW-support.patch
new file mode 100644
index 0000000..a477a57
--- /dev/null
+++ b/0017-socketmodule-add-MINGW-support.patch
@@ -0,0 +1,139 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:34.734994584 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:34.742926057 +0200
+@@ -4523,6 +4523,12 @@ AC_SUBST([LIBMPDEC_CFLAGS])
+ AC_SUBST([LIBMPDEC_INTERNAL])
+ 
+ 
++dnl On MINGW, you need to link against ws2_32 and iphlpapi for sockets to work
++AS_CASE([$MACHDEP],
++  [win32], [SOCKET_LIBS="-lws2_32 -liphlpapi -lrpcrt4"],
++  [SOCKET_LIBS=""]
++)
++
+ dnl detect sqlite3 from Emscripten emport
+ PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
+ 
+@@ -6093,18 +6099,33 @@ if test $ac_cv_header_time_altzone = yes
+     [Define this if your time.h defines altzone.])
+ fi
+ 
++AC_CHECK_HEADERS([ws2tcpip.h])
+ AC_CACHE_CHECK([for addrinfo], [ac_cv_struct_addrinfo],
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <netdb.h>]], [[struct addrinfo a]])],
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#ifdef HAVE_WS2TCPIP_H
++#  include <ws2tcpip.h>
++#else
++#  include <netdb.h>
++#endif]],
++    [[struct addrinfo a]])],
+   [ac_cv_struct_addrinfo=yes],
+   [ac_cv_struct_addrinfo=no]))
+ if test $ac_cv_struct_addrinfo = yes; then
+-	AC_DEFINE([HAVE_ADDRINFO], [1], [struct addrinfo (netdb.h)])
++	AC_DEFINE([HAVE_ADDRINFO], [1], [struct addrinfo])
+ fi
+ 
+ AC_CACHE_CHECK([for sockaddr_storage], [ac_cv_struct_sockaddr_storage],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+-#		include <sys/types.h>
+-@%:@		include <sys/socket.h>]], [[struct sockaddr_storage s]])],
++#ifdef HAVE_WS2TCPIP_H
++#include <ws2tcpip.h>
++#endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_SYS_SOCKET_H
++#include <sys/socket.h>
++#endif]],
++    [[struct sockaddr_storage s]])],
+   [ac_cv_struct_sockaddr_storage=yes],
+   [ac_cv_struct_sockaddr_storage=no]))
+ if test $ac_cv_struct_sockaddr_storage = yes; then
+@@ -7429,7 +7450,10 @@ fi
+ 
+ AC_CHECK_TYPES([socklen_t], [],
+                [AC_DEFINE([socklen_t], [int],
+-                          [Define to 'int' if <sys/socket.h> does not define.])], [
++                          [Define to `int' if <sys/socket.h> or <ws2tcpip.h> does not define.])], [
++#ifdef HAVE_WS2TCPIP_H
++#include <ws2tcpip.h>
++#endif
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+@@ -8377,7 +8401,8 @@ PY_STDLIB_MOD([mmap],
+ PY_STDLIB_MOD([_socket],
+   [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes"
+                     -a "$ac_cv_header_sys_types_h" = "yes"
+-                    -a "$ac_cv_header_netinet_in_h" = "yes"]), [], [$SOCKET_LIBS])
++                    -a "$ac_cv_header_netinet_in_h" = "yes"
++                    -o "$MACHDEP" = "win32"]), [], [$SOCKET_LIBS])
+ 
+ dnl platform specific extensions
+ PY_STDLIB_MOD([grp], [],
+diff -rupN --no-dereference Python-3.14.7/Modules/socketmodule.c Python-3.14.7-new/Modules/socketmodule.c
+--- Python-3.14.7/Modules/socketmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/socketmodule.c	2026-09-22 09:06:34.740464361 +0200
+@@ -289,6 +289,7 @@ shutdown(how) -- shut down traffic in on
+ # include <Rpc.h>
+ 
+ /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */
++#ifdef _MSC_VER
+ #define IPPROTO_ICMP IPPROTO_ICMP
+ #define IPPROTO_IGMP IPPROTO_IGMP
+ #define IPPROTO_GGP IPPROTO_GGP
+@@ -319,6 +320,7 @@ shutdown(how) -- shut down traffic in on
+ #define IPPROTO_PGM IPPROTO_PGM  // WinSock2 only
+ #define IPPROTO_L2TP IPPROTO_L2TP  // WinSock2 only
+ #define IPPROTO_SCTP IPPROTO_SCTP  // WinSock2 only
++#endif /* _MSC_VER */
+ 
+ /* Provides the IsWindows7SP1OrGreater() function */
+ #include <versionhelpers.h>
+@@ -417,7 +419,7 @@ remove_unusable_flags(PyObject *m)
+    * _SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21,
+    * for example, but not by 6.5.10.
+    */
+-#elif defined(_MSC_VER) && _MSC_VER>1201
++#elif (defined(_MSC_VER) && _MSC_VER>1201) || defined(__MINGW32__)
+   /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
+    * EAI_* constants are defined in (the already included) ws2tcpip.h.
+    */
+diff -rupN --no-dereference Python-3.14.7/Modules/socketmodule.h Python-3.14.7-new/Modules/socketmodule.h
+--- Python-3.14.7/Modules/socketmodule.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/socketmodule.h	2026-09-22 09:06:34.742392528 +0200
+@@ -75,8 +75,10 @@ struct SOCKADDR_BTH_REDEF {
+  */
+ # ifdef SIO_GET_MULTICAST_FILTER
+ #  include <mstcpip.h> /* for SIO_RCVALL */
++#ifndef __MINGW32__ /* resolve by configure */
+ #  define HAVE_ADDRINFO
+ #  define HAVE_SOCKADDR_STORAGE
++#endif
+ #  define HAVE_GETADDRINFO
+ #  define HAVE_GETNAMEINFO
+ #  define ENABLE_IPV6
+diff -rupN --no-dereference Python-3.14.7/pyconfig.h.in Python-3.14.7-new/pyconfig.h.in
+--- Python-3.14.7/pyconfig.h.in	2026-09-22 09:06:30.305824266 +0200
++++ Python-3.14.7-new/pyconfig.h.in	2026-09-22 09:06:34.743656766 +0200
+@@ -59,7 +59,7 @@
+ /* Define to 1 if you have the 'acosh' function. */
+ #undef HAVE_ACOSH
+ 
+-/* struct addrinfo (netdb.h) */
++/* struct addrinfo */
+ #undef HAVE_ADDRINFO
+ 
+ /* Define to 1 if you have the 'alarm' function. */
+@@ -2101,7 +2101,7 @@
+ /* Define as 'unsigned int' if <stddef.h> doesn't define. */
+ #undef size_t
+ 
+-/* Define to 'int' if <sys/socket.h> does not define. */
++/* Define to `int' if <sys/socket.h> or <ws2tcpip.h> does not define. */
+ #undef socklen_t
+ 
+ /* Define as 'int' if <sys/types.h> doesn't define. */

diff --git a/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch b/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch
new file mode 100644
index 0000000..8b2bf21
--- /dev/null
+++ b/0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch
@@ -0,0 +1,85 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:35.032443999 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:35.042300890 +0200
+@@ -8639,6 +8639,15 @@ PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_
+ PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes],
+   [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS])
+ 
++dnl windows specific modules
++PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"])
++PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"])
++PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"])
++PY_STDLIB_MOD([winsound], [test "$MACHDEP" = "win32"], [], [],
++  [-lwinmm])
++PY_STDLIB_MOD([_overlapped], [test "$MACHDEP" = "win32"], [], [],
++  [-lws2_32])
++
+ dnl test modules
+ PY_STDLIB_MOD([_testcapi],
+     [test "$TEST_MODULES" = yes],
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.bootstrap.in Python-3.14.7-new/Modules/Setup.bootstrap.in
+--- Python-3.14.7/Modules/Setup.bootstrap.in	2026-09-22 09:06:32.373770526 +0200
++++ Python-3.14.7-new/Modules/Setup.bootstrap.in	2026-09-22 09:06:35.040653843 +0200
+@@ -40,3 +40,8 @@ _symtable symtablemodule.c
+ 
+ # for systems without $HOME env, used by site._getuserbase()
+ @MODULE_PWD_TRUE@pwd pwdmodule.c
++
++# build-in modules for windows platform:
++@MODULE_WINREG_TRUE@winreg ../PC/winreg.c
++@MODULE_MSVCRT_TRUE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c
++@MODULE__WINAPI_TRUE@_winapi _winapi.c
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.stdlib.in Python-3.14.7-new/Modules/Setup.stdlib.in
+--- Python-3.14.7/Modules/Setup.stdlib.in	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/Setup.stdlib.in	2026-09-22 09:06:35.040887889 +0200
+@@ -167,6 +167,12 @@
+ # _scproxy needs SystemConfiguration and CoreFoundation framework
+ @MODULE__SCPROXY_TRUE@_scproxy _scproxy.c
+ 
++############################################################################
++# Windows specific modules
++
++@MODULE__OVERLAPPED_TRUE@_overlapped overlapped.c
++@MODULE_WINSOUND_TRUE@winsound ../PC/winsound.c
++
+ 
+ ############################################################################
+ # Test modules
+diff -rupN --no-dereference Python-3.14.7/Modules/_winapi.c Python-3.14.7-new/Modules/_winapi.c
+--- Python-3.14.7/Modules/_winapi.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_winapi.c	2026-09-22 09:06:35.041199599 +0200
+@@ -46,7 +46,9 @@
+ #endif
+ #include <windows.h>
+ #include <winioctl.h>
++#if defined(Py_DEBUG)
+ #include <crtdbg.h>
++#endif
+ #include "winreparse.h"
+ 
+ #if defined(MS_WIN32) && !defined(MS_WIN64)
+diff -rupN --no-dereference Python-3.14.7/PC/msvcrtmodule.c Python-3.14.7-new/PC/msvcrtmodule.c
+--- Python-3.14.7/PC/msvcrtmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/msvcrtmodule.c	2026-09-22 09:06:35.041572226 +0200
+@@ -22,7 +22,9 @@
+ #include <io.h>
+ #include <conio.h>
+ #include <sys/locking.h>
++#ifdef _DEBUG
+ #include <crtdbg.h>
++#endif
+ #include <windows.h>
+ 
+ #ifdef _MSC_VER
+diff -rupN --no-dereference Python-3.14.7/Python/dynamic_annotations.c Python-3.14.7-new/Python/dynamic_annotations.c
+--- Python-3.14.7/Python/dynamic_annotations.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/dynamic_annotations.c	2026-09-22 09:06:35.041754266 +0200
+@@ -27,7 +27,7 @@
+  * Author: Kostya Serebryany
+  */
+ 
+-#ifdef _MSC_VER
++#ifdef MS_WINDOWS
+ # include <windows.h>
+ #endif
+ 

diff --git a/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch b/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch
new file mode 100644
index 0000000..5cebc17
--- /dev/null
+++ b/0019-sysconfig-make-_sysconfigdata.py-relocatable.patch
@@ -0,0 +1,44 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__main__.py Python-3.14.7-new/Lib/sysconfig/__main__.py
+--- Python-3.14.7/Lib/sysconfig/__main__.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__main__.py	2026-09-22 09:06:35.339589194 +0200
+@@ -2,6 +2,7 @@ import json
+ import os
+ import sys
+ import types
++import textwrap
+ from sysconfig import (
+     _ALWAYS_STR,
+     _PYTHON_BUILD,
+@@ -224,11 +225,32 @@ def _generate_posix_vars():
+     os.makedirs(pybuilddir, exist_ok=True)
+     destfile = os.path.join(pybuilddir, name + '.py')
+ 
++    replacement = """
++        keys_to_replace = [
++            'BINDIR', 'BINLIBDEST', 'CONFINCLUDEDIR',
++            'CONFINCLUDEPY', 'DESTDIRS', 'DESTLIB', 'DESTSHARED',
++            'INCLDIRSTOMAKE', 'INCLUDEDIR', 'INCLUDEPY',
++            'LIBDEST', 'LIBDIR', 'LIBPC', 'LIBPL', 'MACHDESTLIB',
++            'MANDIR', 'SCRIPTDIR', 'datarootdir', 'exec_prefix',
++            'TZPATH', 'AR', 'EXENAME', 'LLVM_PROF_MERGER',
++            'VENVLAUNCHERDIR',
++        ]
++
++        prefix = build_time_vars['BINDIR'][:-4]
++        build_time_vars['prefix'] = sys.base_prefix
++
++        for key in keys_to_replace:
++            value = build_time_vars[key]
++            build_time_vars[key] = value.replace(prefix, sys.base_prefix)
++    """
++
+     with open(destfile, 'w', encoding='utf8') as f:
++        f.write('import sys\n')
+         f.write('# system configuration generated and used by'
+                 ' the sysconfig module\n')
+         f.write('build_time_vars = ')
+         _print_config_dict(vars, stream=f)
++        f.write('\n%s' % textwrap.dedent(replacement))
+ 
+     print(f'Written {destfile}')
+ 

diff --git a/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch b/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch
new file mode 100644
index 0000000..d2bbd44
--- /dev/null
+++ b/0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch
@@ -0,0 +1,66 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__init__.py Python-3.14.7-new/Lib/sysconfig/__init__.py
+--- Python-3.14.7/Lib/sysconfig/__init__.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__init__.py	2026-09-22 09:06:35.623402787 +0200
+@@ -101,7 +101,7 @@ _INSTALL_SCHEMES = {
+     }
+ 
+ # For the OS-native venv scheme, we essentially provide an alias:
+-if os.name == 'nt':
++if os.name == 'nt' and not sys._is_mingw:
+     _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['nt_venv']
+ else:
+     _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv']
+@@ -125,7 +125,7 @@ def _getuserbase():
+     def joinuser(*args):
+         return os.path.expanduser(os.path.join(*args))
+ 
+-    if os.name == "nt":
++    if os.name == "nt" and not sys._is_mingw:
+         base = os.environ.get("APPDATA") or "~"
+         return joinuser(base,  _get_implementation())
+ 
+@@ -287,7 +287,7 @@ def _expand_vars(scheme, vars):
+ 
+ 
+ def _get_preferred_schemes():
+-    if os.name == 'nt':
++    if os.name == 'nt' and not sys._is_mingw:
+         return {
+             'prefix': 'nt',
+             'home': 'posix_home',
+@@ -467,7 +467,7 @@ def parse_config_h(fp, vars=None):
+ def get_config_h_filename():
+     """Return the path of pyconfig.h."""
+     if _PYTHON_BUILD:
+-        if os.name == "nt":
++        if os.name == "nt" and not sys._is_mingw:
+             inc_dir = os.path.join(_PROJECT_BASE, 'PC')
+         else:
+             inc_dir = _PROJECT_BASE
+@@ -520,7 +520,7 @@ def _init_config_vars():
+     except AttributeError:
+         abiflags = ''
+ 
+-    if os.name == 'posix':
++    if os.name == 'posix' or sys._is_mingw:
+         _init_posix(_CONFIG_VARS)
+         # If we are cross-compiling, load the prefixes from the Makefile instead.
+         if '_PYTHON_PROJECT_BASE' in os.environ:
+@@ -552,7 +552,7 @@ def _init_config_vars():
+     except AttributeError:
+         _CONFIG_VARS['py_version_nodot_plat'] = ''
+ 
+-    if os.name == 'nt':
++    if os.name == 'nt' and not sys._is_mingw:
+         _init_non_posix(_CONFIG_VARS)
+         _CONFIG_VARS['VPATH'] = sys._vpath
+     if _HAS_USER_BASE:
+@@ -566,7 +566,7 @@ def _init_config_vars():
+ 
+     # Always convert srcdir to an absolute path
+     srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+-    if os.name == 'posix':
++    if os.name == 'posix' or sys._is_mingw:
+         if _PYTHON_BUILD:
+             # If srcdir is a relative path (typically '.' or '..')
+             # then it should be interpreted relative to the directory

diff --git a/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch b/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch
new file mode 100644
index 0000000..8419689
--- /dev/null
+++ b/0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch
@@ -0,0 +1,40 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__init__.py Python-3.14.7-new/Lib/sysconfig/__init__.py
+--- Python-3.14.7/Lib/sysconfig/__init__.py	2026-09-22 09:06:35.908783311 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__init__.py	2026-09-22 09:06:35.913033244 +0200
+@@ -640,6 +640,7 @@ def get_config_var(name):
+     return get_config_vars().get(name)
+ 
+ 
++# make sure to change site._get_platform() when changing this function
+ def get_platform():
+     """Return a string that identifies the current platform.
+ 
+@@ -667,6 +668,28 @@ def get_platform():
+ 
+     For other non-POSIX platforms, currently just returns :data:`sys.platform`."""
+     if os.name == 'nt':
++        if sys._is_mingw:
++            platform = 'mingw'
++            if 'amd64' in sys.version.lower():
++                platform += '_x86_64'
++            elif 'arm64' in sys.version.lower():
++                platform += '_aarch64'
++            elif 'arm' in sys.version.lower():
++                platform += '_armv7'
++            else:
++                platform += '_i686'
++
++            if 'ucrt' in sys.version.lower():
++                platform += '_ucrt'
++            else:
++                platform += "_msvcrt"
++
++            if 'clang' in sys.version.lower():
++                platform += "_llvm"
++            else:
++                platform += "_gnu"
++
++            return platform
+         if 'amd64' in sys.version.lower():
+             return 'win-amd64'
+         if '(arm)' in sys.version.lower():

diff --git a/0022-build-semi-native-build-sysconfig.patch b/0022-build-semi-native-build-sysconfig.patch
new file mode 100644
index 0000000..308474f
--- /dev/null
+++ b/0022-build-semi-native-build-sysconfig.patch
@@ -0,0 +1,95 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:35.332423079 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:36.203185688 +0200
+@@ -943,6 +943,57 @@ then
+             [Define to include mbstate_t for mbrtowc])
+ fi
+ 
++# On 'semi-native' build systems (MSYS*/Cygwin targeting MinGW-w64)
++# _sysconfigdata.py will contain paths that are correct only in the
++# build environment. This means external modules will fail to build
++# without setting up the same env and also that the build of Python
++# itself will fail as the paths are not correct for the host tools.
++#
++# To work around these issues a set of _b2h variables are created:
++# prefix_b2h, srcdir_b2h, abs_srcdir_b2h
++# and abs_builddir_b2h
++# .. where b2h stands for build to host. sysconfig.py replaces path
++# prefixes matching the non-b2h versions with the b2h equivalents.
++#
++# (note this assumes the host compilers are native and *not* cross
++#  - in the 'semi-native' scenario only that is.)
++
++AC_DEFUN([ABS_PATH_HOST],
++[$1=$(cd $$2 && pwd)
++  case $build_os in
++    mingw*)
++      case $host_os in
++        mingw*) $1=$(cd $$2 && pwd -W) ;;
++        *) ;;
++      esac
++      ;;
++    cygwin*)
++      case $host_os in
++        mingw*) $1=$(cygpath -w -m $$2) ;;
++        *) ;;
++      esac
++      ;;
++  esac
++AC_SUBST([$1])
++])
++
++AC_MSG_CHECKING(absolute host location of prefix)
++ABS_PATH_HOST([prefix_b2h],[prefix])
++AC_MSG_RESULT([$prefix_b2h])
++
++AC_MSG_CHECKING(absolute host location of srcdir)
++ABS_PATH_HOST([srcdir_b2h],[srcdir])
++AC_MSG_RESULT([$srcdir_b2h])
++
++AC_MSG_CHECKING(absolute host location of abs_srcdir)
++ABS_PATH_HOST([abs_srcdir_b2h],[srcdir])
++AC_MSG_RESULT([$abs_srcdir_b2h])
++
++my_builddir=.
++AC_MSG_CHECKING(Absolute host location of abs_builddir)
++ABS_PATH_HOST([abs_builddir_b2h],[my_builddir])
++AC_MSG_RESULT([$abs_builddir_b2h])
++
+ AC_MSG_CHECKING([for posixmodule name])
+ AC_SUBST(MODULE_POSIXMODULE_NAME)
+ case $host in
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__main__.py Python-3.14.7-new/Lib/sysconfig/__main__.py
+--- Python-3.14.7/Lib/sysconfig/__main__.py	2026-09-22 09:06:35.620615951 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__main__.py	2026-09-22 09:06:36.202043566 +0200
+@@ -149,6 +149,14 @@ def _parse_makefile(filename, vars=None,
+         if isinstance(v, str):
+             done[k] = v.strip()
+ 
++    # any keys that have one with the same name suffixed with _b2h
++    # need to be replaced with the value of the _b2h key.
++    # This converts from MSYS*/Cygwin paths to Windows paths.
++    for k, v in dict(done).items():
++        if isinstance(k, str):
++            if k.endswith("_b2h"):
++                done[k[:-4]]=v
++ 
+     # save the results in the global dictionary
+     vars.update(done)
+     return vars
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:34.736009934 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:36.202443753 +0200
+@@ -153,6 +153,12 @@ host_exec_prefix= 	@host_exec_prefix@
+ # Install prefix for data files
+ datarootdir=    @datarootdir@
+ 
++# Locations needed for semi-native fixup of sysconfig.
++srcdir_b2h=		@srcdir_b2h@
++abs_srcdir_b2h=		@abs_srcdir_b2h@
++abs_builddir_b2h=	@abs_builddir_b2h@
++prefix_b2h=		@prefix_b2h@
++
+ # Expanded directories
+ BINDIR=		@bindir@
+ LIBDIR=		@libdir@

diff --git a/0023-ctypes-Add-support-for-stdcall-without-underscore.patch b/0023-ctypes-Add-support-for-stdcall-without-underscore.patch
new file mode 100644
index 0000000..5ef250e
--- /dev/null
+++ b/0023-ctypes-Add-support-for-stdcall-without-underscore.patch
@@ -0,0 +1,34 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_ctypes/_ctypes.c Python-3.14.7-new/Modules/_ctypes/_ctypes.c
+--- Python-3.14.7/Modules/_ctypes/_ctypes.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_ctypes/_ctypes.c	2026-09-22 09:06:36.493342119 +0200
+@@ -3871,11 +3871,30 @@ static PPROC FindAddress(void *handle, c
+     mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */
+     if (!mangled_name)
+         return NULL;
++    /* Issue: for stdcall decorated export functions MSVC compiler adds
++     * underscore, but GCC compiler create them without. This is
++     * visible by example for _ctypes_test.pyd module.
++     * As well functions from system libraries are without underscore.
++     * Solutions:
++     * - If a python module is build with gcc option --add-stdcall-alias
++     * the module will contain XXX as alias for function XXX@ as result
++     * first search in this method will succeed.
++     * - Distutil may use compiler to create def-file, to modify it as
++     * add underscore alias and with new def file to create module.
++     * - Or may be just to search for function without underscore.
++     */
+     for (i = 0; i < 32; ++i) {
+         sprintf(mangled_name, "_%s@%d", name, i*4);
+         Py_BEGIN_ALLOW_THREADS
+         address = (PPROC)GetProcAddress(handle, mangled_name);
+         Py_END_ALLOW_THREADS
++        if (address)
++            return address;
++        /* search for function without underscore as weel */
++        sprintf(mangled_name, "%s@%d", name, i*4);
++        Py_BEGIN_ALLOW_THREADS
++        address = (PPROC)GetProcAddress(handle, mangled_name);
++        Py_END_ALLOW_THREADS
+         if (address)
+             return address;
+     }

diff --git a/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch b/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch
new file mode 100644
index 0000000..d9f6697
--- /dev/null
+++ b/0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/ctypes/__init__.py Python-3.14.7-new/Lib/ctypes/__init__.py
+--- Python-3.14.7/Lib/ctypes/__init__.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/ctypes/__init__.py	2026-09-22 09:06:36.781322035 +0200
+@@ -558,7 +558,9 @@ class LibraryLoader(object):
+ cdll = LibraryLoader(CDLL)
+ pydll = LibraryLoader(PyDLL)
+ 
+-if _os.name == "nt":
++if _os.name == "nt" and _sys._is_mingw:
++    pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
++elif _os.name == "nt":
+     pythonapi = PyDLL("python dll", None, _sys.dllhandle)
+ elif _sys.platform in ["android", "cygwin"]:
+     # These are Unix-like platforms which use a dynamically-linked libpython.

diff --git a/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch b/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch
new file mode 100644
index 0000000..fb3c122
--- /dev/null
+++ b/0025-ctypes-find_library-c-should-return-None-with-ucrt.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/ctypes/util.py Python-3.14.7-new/Lib/ctypes/util.py
+--- Python-3.14.7/Lib/ctypes/util.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/ctypes/util.py	2026-09-22 09:06:37.072978628 +0200
+@@ -54,6 +54,10 @@ if os.name == "nt":
+ 
+     def find_library(name):
+         if name in ('c', 'm'):
++            if sys._is_mingw:
++                if sys._is_mingw_ucrt:
++                    return None
++                return 'msvcrt.dll'
+             return find_msvcrt()
+         # See MSDN for the REAL search order.
+         for directory in os.environ['PATH'].split(os.pathsep):

diff --git a/0026-site-Customize-for-MINGW.patch b/0026-site-Customize-for-MINGW.patch
new file mode 100644
index 0000000..e6054c8
--- /dev/null
+++ b/0026-site-Customize-for-MINGW.patch
@@ -0,0 +1,39 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/site.py Python-3.14.7-new/Lib/site.py
+--- Python-3.14.7/Lib/site.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/site.py	2026-09-22 09:06:37.363054051 +0200
+@@ -305,7 +305,7 @@ def _getuserbase():
+     def joinuser(*args):
+         return os.path.expanduser(os.path.join(*args))
+ 
+-    if os.name == "nt":
++    if os.name == "nt" and not sys._is_mingw:
+         base = os.environ.get("APPDATA") or "~"
+         return joinuser(base, _get_implementation())
+ 
+@@ -326,7 +326,7 @@ def _get_path(userbase):
+ 
+     implementation = _get_implementation()
+     implementation_lower = implementation.lower()
+-    if os.name == 'nt':
++    if os.name == 'nt' and not sys._is_mingw:
+         ver_nodot = sys.winver.replace('.', '')
+         return f'{userbase}\\{implementation}{ver_nodot}\\site-packages'
+ 
+@@ -405,7 +405,7 @@ def getsitepackages(prefixes=None):
+             abi_thread = 't'
+         else:
+             abi_thread = ''
+-        if os.sep == '/':
++        if os.name == 'posix' or sys._is_mingw:
+             libdirs = [sys.platlibdir]
+             if sys.platlibdir != "lib":
+                 libdirs.append("lib")
+@@ -436,7 +436,7 @@ def setquit():
+     The repr of each object contains a hint at how it works.
+ 
+     """
+-    if os.sep == '\\':
++    if sys.platform == 'win32':
+         eof = 'Ctrl-Z plus Return'
+     else:
+         eof = 'Ctrl-D (i.e. EOF)'

diff --git a/0027-site-Change-user-site-packages-path-to-include-the-e.patch b/0027-site-Change-user-site-packages-path-to-include-the-e.patch
new file mode 100644
index 0000000..159b42c
--- /dev/null
+++ b/0027-site-Change-user-site-packages-path-to-include-the-e.patch
@@ -0,0 +1,79 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/site.py Python-3.14.7-new/Lib/site.py
+--- Python-3.14.7/Lib/site.py	2026-09-22 09:06:37.645544942 +0200
++++ Python-3.14.7-new/Lib/site.py	2026-09-22 09:06:37.649534105 +0200
+@@ -315,6 +315,32 @@ def _getuserbase():
+ 
+     return joinuser("~", ".local")
+ 
++# Copy of sysconfig.get_platform() but only for MinGW
++def _get_platform():
++    if os.name == 'nt':
++        if sys._is_mingw:
++            platform = 'mingw'
++            if 'amd64' in sys.version.lower():
++                platform += '_x86_64'
++            elif 'arm64' in sys.version.lower():
++                platform += '_aarch64'
++            elif 'arm' in sys.version.lower():
++                platform += '_armv7'
++            else:
++                platform += '_i686'
++
++            if 'ucrt' in sys.version.lower():
++                platform += '_ucrt'
++            else:
++                platform += "_msvcrt"
++
++            if 'clang' in sys.version.lower():
++                platform += "_llvm"
++            else:
++                platform += "_gnu"
++
++            return platform
++    return sys.platform
+ 
+ # Same to sysconfig.get_path('purelib', os.name+'_user')
+ def _get_path(userbase):
+@@ -326,7 +352,10 @@ def _get_path(userbase):
+ 
+     implementation = _get_implementation()
+     implementation_lower = implementation.lower()
+-    if os.name == 'nt' and not sys._is_mingw:
++    if os.name == 'nt':
++        if sys._is_mingw:
++            return f'{userbase}/lib/{implementation_lower}{version[0]}.{version[1]}-{_get_platform()}{abi_thread}/site-packages'
++
+         ver_nodot = sys.winver.replace('.', '')
+         return f'{userbase}\\{implementation}{ver_nodot}\\site-packages'
+ 
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__init__.py Python-3.14.7-new/Lib/sysconfig/__init__.py
+--- Python-3.14.7/Lib/sysconfig/__init__.py	2026-09-22 09:06:36.198230106 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__init__.py	2026-09-22 09:06:37.649800285 +0200
+@@ -150,11 +150,11 @@ if _HAS_USER_BASE:
+             'data': '{userbase}',
+             },
+         'posix_user': {
+-            'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
+-            'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
+-            'purelib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
+-            'platlib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
+-            'include': '{userbase}/include/{implementation_lower}{py_version_short}{abi_thread}',
++            'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short_plat}{abi_thread}',
++            'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short_plat}{abi_thread}',
++            'purelib': '{userbase}/lib/{implementation_lower}{py_version_short_plat}{abi_thread}/site-packages',
++            'platlib': '{userbase}/lib/{implementation_lower}{py_version_short_plat}{abi_thread}/site-packages',
++            'include': '{userbase}/include/{implementation_lower}{py_version_short_plat}{abi_thread}',
+             'scripts': '{userbase}/bin',
+             'data': '{userbase}',
+             },
+@@ -551,6 +551,10 @@ def _init_config_vars():
+         _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '')
+     except AttributeError:
+         _CONFIG_VARS['py_version_nodot_plat'] = ''
++    if os.name == 'nt' and sys._is_mingw:
++        _CONFIG_VARS['py_version_short_plat'] = f'{_PY_VERSION_SHORT}-{get_platform()}'
++    else:
++        _CONFIG_VARS['py_version_short_plat'] = _PY_VERSION_SHORT
+ 
+     if os.name == 'nt' and not sys._is_mingw:
+         _init_non_posix(_CONFIG_VARS)

diff --git a/0028-python-config-output-Windows-paths-for-the-shell-var.patch b/0028-python-config-output-Windows-paths-for-the-shell-var.patch
new file mode 100644
index 0000000..fae0cb1
--- /dev/null
+++ b/0028-python-config-output-Windows-paths-for-the-shell-var.patch
@@ -0,0 +1,16 @@
+diff -rupN --no-dereference Python-3.14.7/Misc/python-config.sh.in Python-3.14.7-new/Misc/python-config.sh.in
+--- Python-3.14.7/Misc/python-config.sh.in	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Misc/python-config.sh.in	2026-09-22 09:06:37.937612923 +0200
+@@ -27,6 +27,12 @@ installed_prefix ()
+           RESULT=$(readlink -f "$RESULT")
+         fi
+     fi
++    # Since we don't know where the output from this script will end up
++    # we keep all paths in Windows-land since MSYS2 can handle that
++    # while native tools can't handle paths in MSYS2-land.
++    if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] ; then
++        RESULT=$(cd "$RESULT" && pwd -W)
++    fi
+     echo $RESULT
+ }
+ 

diff --git a/0029-python-config-use-the-Python-variant-of-python-confi.patch b/0029-python-config-use-the-Python-variant-of-python-confi.patch
new file mode 100644
index 0000000..39e3d83
--- /dev/null
+++ b/0029-python-config-use-the-Python-variant-of-python-confi.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:36.489751486 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:38.229221059 +0200
+@@ -2857,6 +2857,10 @@ python-config: $(srcdir)/Misc/python-con
+ 	@if test `uname -s` = Darwin; then \
+ 		cp python-config.py python-config; \
+ 	fi
++	@ # On Windows, use the python version of the script so no bash is required
++	@if test "$(MACHDEP)" = "win32"; then \
++		cp python-config.py python-config; \
++	fi
+ 
+ # macOS' make seems to ignore a dependency on a
+ # "$(BUILD_SCRIPTS_DIR): $(MKDIR_P) $@" rule.

diff --git a/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch b/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch
new file mode 100644
index 0000000..85c2771
--- /dev/null
+++ b/0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch
@@ -0,0 +1,478 @@
+diff -rupN --no-dereference Python-3.14.7/Include/pylifecycle.h Python-3.14.7-new/Include/pylifecycle.h
+--- Python-3.14.7/Include/pylifecycle.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/pylifecycle.h	2026-09-22 09:06:38.534052117 +0200
+@@ -21,6 +21,12 @@ PyAPI_FUNC(int) Py_IsInitialized(void);
+ PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
+ PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
+ 
++PyAPI_FUNC(wchar_t) Py_GetSepW(const wchar_t *);
++PyAPI_FUNC(char) Py_GetSepA(const char *);
++
++PyAPI_FUNC(void) Py_NormalizeSepsW(wchar_t *);
++PyAPI_FUNC(void) Py_NormalizeSepsA(char *);
++
+ 
+ /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
+  * exit functions.
+diff -rupN --no-dereference Python-3.14.7/Lib/ntpath.py Python-3.14.7-new/Lib/ntpath.py
+--- Python-3.14.7/Lib/ntpath.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/ntpath.py	2026-09-22 09:06:38.534373183 +0200
+@@ -11,14 +11,22 @@ module as os.path.
+ curdir = '.'
+ pardir = '..'
+ extsep = '.'
+-sep = '\\'
+ pathsep = ';'
+-altsep = '/'
+ defpath = '.;C:\\bin'
+ devnull = 'nul'
+ 
+-import os
+ import sys
++
++if sys._use_alt_sep:
++    sep = '/'
++    altsep = '\\'
++else:
++    sep = '\\'
++    altsep = '/'
++bsep = str.encode(sep)
++baltsep = str.encode(altsep)
++
++import os
+ import genericpath
+ from genericpath import *
+ 
+@@ -33,9 +41,39 @@ __all__ = ["normcase","isabs","join","sp
+ 
+ def _get_bothseps(path):
+     if isinstance(path, bytes):
+-        return b'\\/'
++        return bsep+baltsep
++    else:
++        return sep+altsep
++
++def _get_sep(path):
++    if isinstance(path, bytes):
++        return bsep
+     else:
+-        return '\\/'
++        return sep
++
++def _get_altsep(path):
++    if isinstance(path, bytes):
++        return baltsep
++    else:
++        return altsep
++
++def _get_colon(path):
++    if isinstance(path, bytes):
++        return b':'
++    else:
++        return ':'
++
++def _get_colon_seps(path):
++    if isinstance(path, bytes):
++        return b':'+bsep+baltsep
++    else:
++        return ':'+sep+altsep
++
++def _get_unc_prefix(path):
++    if isinstance(path, bytes):
++        return b'\\\\?\\UNC\\'
++    else:
++        return '\\\\?\\UNC\\'
+ 
+ # Normalize the case of a pathname and map slashes to backslashes.
+ # Other normalizations (such as optimizing '../' away) are not done
+@@ -57,14 +95,14 @@ try:
+             return s
+         if isinstance(s, bytes):
+             encoding = sys.getfilesystemencoding()
+-            s = s.decode(encoding, 'surrogateescape').replace('/', '\\')
++            s = s.decode(encoding, 'surrogateescape').replace(altsep, sep)
+             s = _LCMapStringEx(_LOCALE_NAME_INVARIANT,
+                                _LCMAP_LOWERCASE, s)
+             return s.encode(encoding, 'surrogateescape')
+         else:
+             return _LCMapStringEx(_LOCALE_NAME_INVARIANT,
+                                   _LCMAP_LOWERCASE,
+-                                  s.replace('/', '\\'))
++                                  s.replace(altsep, sep))
+ except ImportError:
+     def normcase(s):
+         """Normalize case of pathname.
+@@ -73,23 +111,17 @@ except ImportError:
+         """
+         s = os.fspath(s)
+         if isinstance(s, bytes):
+-            return os.fsencode(os.fsdecode(s).replace('/', '\\').lower())
+-        return s.replace('/', '\\').lower()
++            return os.fsencode(os.fsdecode(s).replace(altsep, sep).lower())
++        return s.replace(altsep, sep).lower()
+ 
+ 
+ def isabs(s):
+     """Test whether a path is absolute"""
+     s = os.fspath(s)
+-    if isinstance(s, bytes):
+-        sep = b'\\'
+-        altsep = b'/'
+-        colon_sep = b':\\'
+-        double_sep = b'\\\\'
+-    else:
+-        sep = '\\'
+-        altsep = '/'
+-        colon_sep = ':\\'
+-        double_sep = '\\\\'
++    sep = _get_sep(s)
++    altsep = _get_altsep(s)
++    colon_sep = _get_colon(s) + sep
++    double_sep = sep + sep
+     s = s[:3].replace(altsep, sep)
+     # Absolute: UNC, device, and paths with a drive and root.
+     return s.startswith(colon_sep, 1) or s.startswith(double_sep)
+@@ -98,14 +130,9 @@ def isabs(s):
+ # Join two (or more) paths.
+ def join(path, *paths):
+     path = os.fspath(path)
+-    if isinstance(path, bytes):
+-        sep = b'\\'
+-        seps = b'\\/'
+-        colon_seps = b':\\/'
+-    else:
+-        sep = '\\'
+-        seps = '\\/'
+-        colon_seps = ':\\/'
++    sep = _get_sep(path)
++    seps = _get_bothseps(path)
++    colon_seps = _get_colon_seps(path)
+     try:
+         result_drive, result_root, result_path = splitroot(path)
+         for p in paths:
+@@ -176,18 +203,12 @@ except ImportError:
+ 
+         The tail contains anything after the root."""
+         p = os.fspath(p)
+-        if isinstance(p, bytes):
+-            sep = b'\\'
+-            altsep = b'/'
+-            colon = b':'
+-            unc_prefix = b'\\\\?\\UNC\\'
+-            empty = b''
+-        else:
+-            sep = '\\'
+-            altsep = '/'
+-            colon = ':'
+-            unc_prefix = '\\\\?\\UNC\\'
+-            empty = ''
++        sep = _get_sep(p)
++        altsep = _get_altsep(p)
++        colon = _get_colon(p)
++        unc_prefix = _get_unc_prefix(p)
++        empty = b'' if isinstance(p, bytes) else ''
++
+         normp = p.replace(altsep, sep)
+         if normp[:1] == sep:
+             if normp[1:2] == sep:
+@@ -245,9 +266,9 @@ def split(p):
+ def splitext(p):
+     p = os.fspath(p)
+     if isinstance(p, bytes):
+-        return genericpath._splitext(p, b'\\', b'/', b'.')
++        return genericpath._splitext(p, bsep, baltsep, b'.')
+     else:
+-        return genericpath._splitext(p, '\\', '/', '.')
++        return genericpath._splitext(p, sep, altsep, '.')
+ splitext.__doc__ = genericpath._splitext.__doc__
+ 
+ 
+@@ -362,7 +383,7 @@ def expanduser(path):
+     if 'USERPROFILE' in os.environ:
+         userhome = os.environ['USERPROFILE']
+     elif 'HOMEPATH' not in os.environ:
+-        return path
++        return os.path.normpath(path)
+     else:
+         drive = os.environ.get('HOMEDRIVE', '')
+         userhome = join(drive, os.environ['HOMEPATH'])
+@@ -386,7 +407,7 @@ def expanduser(path):
+     if isinstance(path, bytes):
+         userhome = os.fsencode(userhome)
+ 
+-    return userhome + path[i:]
++    return os.path.normpath(userhome) + path[i:]
+ 
+ 
+ # Expand paths containing shell variable substitutions.
+@@ -477,14 +498,12 @@ except ImportError:
+     def normpath(path):
+         """Normalize path, eliminating double slashes, etc."""
+         path = os.fspath(path)
++        sep = _get_sep(path)
++        altsep = _get_altsep(path)
+         if isinstance(path, bytes):
+-            sep = b'\\'
+-            altsep = b'/'
+             curdir = b'.'
+             pardir = b'..'
+         else:
+-            sep = '\\'
+-            altsep = '/'
+             curdir = '.'
+             pardir = '..'
+         path = path.replace(altsep, sep)
+@@ -531,7 +550,7 @@ else:  # use native Windows method on Wi
+     def abspath(path):
+         """Return the absolute version of a path."""
+         try:
+-            return _getfullpathname(normpath(path))
++            return normpath(_getfullpathname(normpath(path)))
+         except (OSError, ValueError):
+             # See gh-75230, handle outside for cleaner traceback
+             pass
+@@ -730,6 +749,7 @@ else:
+                 # strip the prefix anyway.
+                 if ex.winerror == initial_winerror:
+                     path = spath
++        path = normpath(path)
+         return path
+ 
+ 
+@@ -742,12 +762,11 @@ def relpath(path, start=None):
+     if not path:
+         raise ValueError("no path specified")
+ 
++    sep = _get_sep(path)
+     if isinstance(path, bytes):
+-        sep = b'\\'
+         curdir = b'.'
+         pardir = b'..'
+     else:
+-        sep = '\\'
+         curdir = '.'
+         pardir = '..'
+ 
+@@ -799,13 +818,11 @@ def commonpath(paths):
+     if not paths:
+         raise ValueError('commonpath() arg is an empty iterable')
+ 
++    sep = _get_sep(paths[0])
++    altsep = _get_altsep(paths[0])
+     if isinstance(paths[0], bytes):
+-        sep = b'\\'
+-        altsep = b'/'
+         curdir = b'.'
+     else:
+-        sep = '\\'
+-        altsep = '/'
+         curdir = '.'
+ 
+     try:
+diff -rupN --no-dereference Python-3.14.7/Modules/posixmodule.c Python-3.14.7-new/Modules/posixmodule.c
+--- Python-3.14.7/Modules/posixmodule.c	2026-09-22 09:06:32.371629555 +0200
++++ Python-3.14.7-new/Modules/posixmodule.c	2026-09-22 09:06:38.536199649 +0200
+@@ -4265,6 +4265,7 @@ posix_getcwd(int use_bytes)
+         return NULL;
+     }
+ 
++    Py_NormalizeSepsW(wbuf2);
+     PyObject *resobj = PyUnicode_FromWideChar(wbuf2, len);
+     if (wbuf2 != wbuf) {
+         PyMem_RawFree(wbuf2);
+@@ -5146,6 +5147,7 @@ os__getfinalpathname_impl(PyObject *modu
+         target_path = tmp;
+     }
+ 
++    Py_NormalizeSepsW(target_path);
+     result = PyUnicode_FromWideChar(target_path, result_length);
+     if (result && PyBytes_Check(path->object)) {
+         Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
+diff -rupN --no-dereference Python-3.14.7/Python/initconfig.c Python-3.14.7-new/Python/initconfig.c
+--- Python-3.14.7/Python/initconfig.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/initconfig.c	2026-09-22 09:06:38.537199580 +0200
+@@ -477,7 +477,7 @@ static const char usage_envvars[] =
+ "PYTHONWARNINGS  : warning control (-W)\n"
+ ;
+ 
+-#if defined(MS_WINDOWS)
++#if defined(_MSC_VER)
+ #  define PYTHONHOMEHELP "<prefix>\\python{major}{minor}"
+ #else
+ #  define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
+diff -rupN --no-dereference Python-3.14.7/Python/pathconfig.c Python-3.14.7-new/Python/pathconfig.c
+--- Python-3.14.7/Python/pathconfig.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/pathconfig.c	2026-09-22 09:06:38.537570969 +0200
+@@ -8,7 +8,7 @@
+ #include <wchar.h>
+ 
+ #include "marshal.h"              // PyMarshal_ReadObjectFromString
+-#include "osdefs.h"               // DELIM
++#include "osdefs.h"               // DELIM, SEP
+ 
+ #ifdef MS_WINDOWS
+ #  include <windows.h>            // GetFullPathNameW(), MAX_PATH
+@@ -16,6 +16,142 @@
+ #  include <shlwapi.h>
+ #endif
+ 
++#ifdef __MINGW32__
++#define wcstok  wcstok_s
++#include <windows.h>
++#endif
++
++static int
++Py_StartsWithA(const char * str, const char * prefix)
++{
++    while(*prefix)
++    {
++        if(*prefix++ != *str++)
++            return 0;
++    }
++
++    return 1;
++}
++
++static int
++Py_StartsWithW(const wchar_t * str, const wchar_t * prefix)
++{
++    while(*prefix)
++    {
++        if(*prefix++ != *str++)
++            return 0;
++    }
++
++    return 1;
++}
++
++char
++Py_GetSepA(const char *name)
++{
++    static char sep = '\0';
++#ifdef _WIN32
++    /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx
++     * The "\\?\" prefix .. indicate that the path should be passed to the system with minimal
++     * modification, which means that you cannot use forward slashes to represent path separators
++     */
++    if (name != NULL && Py_StartsWithA(name, "\\\\?\\") != 0)
++    {
++        return '\\';
++    }
++#endif
++    if (sep != '\0')
++        return sep;
++#if defined(__MINGW32__)
++    char* msystem = getenv("MSYSTEM");
++    if (msystem != NULL && strcmp(msystem, "") != 0)
++        sep = '/';
++    else
++        sep = '\\';
++#else
++    sep = SEP;
++#endif
++    return sep;
++}
++
++static char
++Py_GetAltSepA(const char *name)
++{
++    char sep = Py_GetSepA(name);
++    if (sep == '/')
++        return '\\';
++    return '/';
++}
++
++void
++Py_NormalizeSepsA(char *name)
++{
++    assert(name != NULL);
++    char sep = Py_GetSepA(name);
++    char altsep = Py_GetAltSepA(name);
++    char* seps;
++    if (name[0] != '\0' && name[1] == ':') {
++        name[0] = toupper(name[0]);
++    }
++    seps = strchr(name, altsep);
++    while(seps) {
++        *seps = sep;
++        seps = strchr(seps, altsep);
++    }
++}
++
++wchar_t
++Py_GetSepW(const wchar_t *name)
++{
++    static wchar_t sep = L'\0';
++#ifdef _WIN32
++    /* https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx
++     * The "\\?\" prefix .. indicate that the path should be passed to the system with minimal
++     * modification, which means that you cannot use forward slashes to represent path separators
++     */
++    if (name != NULL && Py_StartsWithW(name, L"\\\\?\\") != 0)
++    {
++        return L'\\';
++    }
++#endif
++    if (sep != L'\0')
++        return sep;
++#if defined(__MINGW32__)
++    char* msystem = getenv("MSYSTEM");
++    if (msystem != NULL && strcmp(msystem, "") != 0)
++        sep = L'/';
++    else
++        sep = L'\\';
++#else
++    sep = SEP;
++#endif
++    return sep;
++}
++
++static wchar_t
++Py_GetAltSepW(const wchar_t *name)
++{
++    char sep = Py_GetSepW(name);
++    if (sep == L'/')
++        return L'\\';
++    return L'/';
++}
++
++void
++Py_NormalizeSepsW(wchar_t *name)
++{
++    assert(name != NULL);
++    wchar_t sep = Py_GetSepW(name);
++    wchar_t altsep = Py_GetAltSepW(name);
++    wchar_t* seps;
++    if (name[0] != L'\0' && name[1] == L':') {
++        name[0] = towupper(name[0]);
++    }
++    seps = wcschr(name, altsep);
++    while(seps) {
++        *seps = sep;
++        seps = wcschr(seps, altsep);
++    }
++}
+ 
+ /* External interface */
+ 
+@@ -461,7 +597,7 @@ _PyPathConfig_ComputeSysPath0(const PyWi
+     }
+ #endif /* All others */
+ 
+-    PyObject *path0_obj = PyUnicode_FromWideChar(path0, n);
++    PyObject *path0_obj = PyUnicode_FromWideChar(_Py_normpath(path0, -1), n);
+     if (path0_obj == NULL) {
+         return -1;
+     }
+diff -rupN --no-dereference Python-3.14.7/Python/traceback.c Python-3.14.7-new/Python/traceback.c
+--- Python-3.14.7/Python/traceback.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/traceback.c	2026-09-22 09:06:38.537799098 +0200
+@@ -398,7 +398,7 @@ _Py_FindSourceFile(PyObject *filename, c
+     filepath = PyBytes_AS_STRING(filebytes);
+ 
+     /* Search tail of filename in sys.path before giving up */
+-    tail = strrchr(filepath, SEP);
++    tail = strrchr(filepath, Py_GetSepA(filepath));
+     if (tail == NULL)
+         tail = filepath;
+     else

diff --git a/0031-build-Remove-MAXPATHLEN-default.patch b/0031-build-Remove-MAXPATHLEN-default.patch
new file mode 100644
index 0000000..b517584
--- /dev/null
+++ b/0031-build-Remove-MAXPATHLEN-default.patch
@@ -0,0 +1,11 @@
+diff -rupN --no-dereference Python-3.14.7/Include/osdefs.h Python-3.14.7-new/Include/osdefs.h
+--- Python-3.14.7/Include/osdefs.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/osdefs.h	2026-09-22 09:06:38.842087355 +0200
+@@ -16,7 +16,6 @@ extern "C" {
+ #ifdef MS_WINDOWS
+ #  define SEP L'\\'
+ #  define ALTSEP L'/'
+-#  define MAXPATHLEN 256
+ #  define DELIM L';'
+ #endif
+ 

diff --git a/0032-build-dont-link-with-gettext.patch b/0032-build-dont-link-with-gettext.patch
new file mode 100644
index 0000000..d726951
--- /dev/null
+++ b/0032-build-dont-link-with-gettext.patch
@@ -0,0 +1,41 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:36.487342537 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:39.142157389 +0200
+@@ -4149,10 +4149,19 @@ AC_SEARCH_LIBS([sem_init], [pthread rt p
+ fi
+ 
+ # check if we need libintl for locale functions
++case $host in
++  *-*-mingw*)
++  dnl Native windows build don't use libintl (see _localemodule.c).
++  dnl Also we don't like setup.py to add "intl" library to the list
++  dnl when build _locale module.
++  ;;
++  *)
+ AC_CHECK_LIB([intl], [textdomain],
+ 	[AC_DEFINE([WITH_LIBINTL], [1],
+ 	[Define to 1 if libintl is needed for locale functions.])
+         LIBS="-lintl $LIBS"])
++  ;;
++esac
+ 
+ # checks for system dependent C++ extensions support
+ case "$ac_sys_system" in
+diff -rupN --no-dereference Python-3.14.7/Modules/_localemodule.c Python-3.14.7-new/Modules/_localemodule.c
+--- Python-3.14.7/Modules/_localemodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_localemodule.c	2026-09-22 09:06:39.141574243 +0200
+@@ -13,6 +13,14 @@ This software comes with no warranty. Us
+ #include "pycore_fileutils.h"     // _Py_GetLocaleconvNumeric()
+ #include "pycore_pymem.h"         // _PyMem_Strdup()
+ 
++#ifdef __MINGW32__
++/* The header libintl.h and library libintl may exist on mingw host.
++ * To be compatible with MSVC build we has to undef some defines.
++ */
++#undef HAVE_LIBINTL_H
++#undef HAVE_BIND_TEXTDOMAIN_CODESET
++#endif
++
+ #include <locale.h>               // setlocale()
+ #include <string.h>               // strlen()
+ #ifdef HAVE_ERRNO_H

diff --git a/0033-use-gnu_printf-in-format.patch b/0033-use-gnu_printf-in-format.patch
new file mode 100644
index 0000000..4fc4dd6
--- /dev/null
+++ b/0033-use-gnu_printf-in-format.patch
@@ -0,0 +1,61 @@
+diff -rupN --no-dereference Python-3.14.7/Include/bytesobject.h Python-3.14.7-new/Include/bytesobject.h
+--- Python-3.14.7/Include/bytesobject.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/bytesobject.h	2026-09-22 09:06:39.438653093 +0200
+@@ -32,9 +32,9 @@ PyAPI_FUNC(PyObject *) PyBytes_FromStrin
+ PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *);
+ PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
+ PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list)
+-                                Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
++                                Py_PRINTF(1, 0);
+ PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...)
+-                                Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
++                                Py_PRINTF(1, 2);
+ PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *);
+ PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
+ PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
+diff -rupN --no-dereference Python-3.14.7/Include/pyerrors.h Python-3.14.7-new/Include/pyerrors.h
+--- Python-3.14.7/Include/pyerrors.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/pyerrors.h	2026-09-22 09:06:39.438878171 +0200
+@@ -319,9 +319,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_
+     );
+ 
+ PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char  *format, ...)
+-                        Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
++                        Py_PRINTF(3, 4);
+ PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char  *format, va_list va)
+-                        Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
++                        Py_PRINTF(3, 0);
+ 
+ #ifndef Py_LIMITED_API
+ #  define Py_CPYTHON_ERRORS_H
+diff -rupN --no-dereference Python-3.14.7/Include/pyport.h Python-3.14.7-new/Include/pyport.h
+--- Python-3.14.7/Include/pyport.h	2026-09-22 09:06:30.598955858 +0200
++++ Python-3.14.7-new/Include/pyport.h	2026-09-22 09:06:39.439089159 +0200
+@@ -507,6 +507,12 @@ extern "C" {
+ 
+ #define Py_VA_COPY va_copy
+ 
++#if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__>= 4) || __GNUC__ > 4)
++#  define Py_PRINTF(X,Y) Py_GCC_ATTRIBUTE((format(gnu_printf,X,Y)))
++#else
++#  define Py_PRINTF(X,Y) Py_GCC_ATTRIBUTE((format(printf,X,Y)))
++#endif
++
+ /*
+  * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
+  * detected by configure and defined in pyconfig.h. The code in pyconfig.h
+diff -rupN --no-dereference Python-3.14.7/Include/sysmodule.h Python-3.14.7-new/Include/sysmodule.h
+--- Python-3.14.7/Include/sysmodule.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/sysmodule.h	2026-09-22 09:06:39.439303698 +0200
+@@ -11,9 +11,9 @@ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PyS
+ Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
+ 
+ PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
+-                 Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
++                 Py_PRINTF(1, 2);
+ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
+-                 Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
++                 Py_PRINTF(1, 2);
+ PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
+ PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
+ 

diff --git a/0034-build-remove-usage-of-MS_COREDLL.patch b/0034-build-remove-usage-of-MS_COREDLL.patch
new file mode 100644
index 0000000..5275c9c
--- /dev/null
+++ b/0034-build-remove-usage-of-MS_COREDLL.patch
@@ -0,0 +1,38 @@
+diff -rupN --no-dereference Python-3.14.7/Python/sysmodule.c Python-3.14.7-new/Python/sysmodule.c
+--- Python-3.14.7/Python/sysmodule.c	2026-09-22 09:06:30.887178544 +0200
++++ Python-3.14.7-new/Python/sysmodule.c	2026-09-22 09:06:39.743115477 +0200
+@@ -53,7 +53,7 @@ Data members:
+ #  include <windows.h>
+ #endif /* MS_WINDOWS */
+ 
+-#ifdef MS_COREDLL
++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED)
+ extern void *PyWin_DLLhModule;
+ /* A string loaded from the DLL at startup: */
+ extern const char *PyWin_DLLVersionString;
+@@ -3368,14 +3368,14 @@ version -- the version of this interpret
+ version_info -- version information as a named tuple\n\
+ "
+ )
+-#ifdef MS_COREDLL
++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED)
+ /* concatenating string here */
+ PyDoc_STR(
+ "dllhandle -- [Windows only] integer handle of the Python DLL\n\
+ winver -- [Windows only] version number of the Python DLL\n\
+ "
+ )
+-#endif /* MS_COREDLL */
++#endif /* defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) */
+ #ifdef MS_WINDOWS
+ /* concatenating string here */
+ PyDoc_STR(
+@@ -3925,7 +3925,7 @@ _PySys_InitCore(PyThreadState *tstate, P
+     SET_SYS("_is_mingw_ucrt", PyLong_FromLong(is_mingw_ucrt()));
+     SET_SYS("_use_alt_sep", PyLong_FromLong(use_alt_sep()));
+ 
+-#ifdef MS_COREDLL
++#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED)
+     SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule));
+     SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString);
+ #endif

diff --git a/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch b/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch
new file mode 100644
index 0000000..fc377e1
--- /dev/null
+++ b/0035-getcompiler-expose-MINGW-toolchain-related-informati.patch
@@ -0,0 +1,57 @@
+diff -rupN --no-dereference Python-3.14.7/Python/getcompiler.c Python-3.14.7-new/Python/getcompiler.c
+--- Python-3.14.7/Python/getcompiler.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/getcompiler.c	2026-09-22 09:06:40.060967690 +0200
+@@ -7,10 +7,51 @@
+ 
+ // Note the __clang__ conditional has to come before the __GNUC__ one because
+ // clang pretends to be GCC.
+-#if defined(__clang__)
++#if defined(__clang__) && !defined(_WIN32)
+ #define COMPILER "[Clang " __clang_version__ "]"
+ #elif defined(__GNUC__)
+-#define COMPILER "[GCC " __VERSION__ "]"
++/* To not break compatibility with things that determine
++   CPU arch by calling get_build_version in msvccompiler.py
++   (such as NumPy) add "32 bit" or "64 bit (AMD64)" on Windows
++   and also use a space as a separator rather than a newline. */
++#if defined(_WIN32)
++#  define COMP_SEP " "
++#  if defined(__x86_64__)
++#    define ARCH_SUFFIX " 64 bit (AMD64)"
++#  elif defined(__aarch64__)
++#    define ARCH_SUFFIX " 64 bit (ARM64)"
++#  elif defined(__arm__)
++#    define ARCH_SUFFIX " 32 bit (ARM)"
++#  else
++#    define ARCH_SUFFIX " 32 bit"
++#  endif
++#else
++#  define COMP_SEP "\n"
++#  define ARCH_SUFFIX ""
++#endif
++
++#if defined __MINGW32__
++#  define ARCH_PREFIX "MINGW "
++#else
++#  define ARCH_PREFIX ""
++#endif
++
++#if defined(__clang__)
++#define CLANG_VERSION_STRING Py_STRINGIFY(__clang_major__) "." Py_STRINGIFY(__clang_minor__) "." Py_STRINGIFY(__clang_patchlevel__)
++#  if defined(_UCRT)
++// Some code checks for "GCC" in the compiler string, so we include it here.
++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang UCRT " CLANG_VERSION_STRING ARCH_SUFFIX " (GCC)]"
++#  else
++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "Clang " CLANG_VERSION_STRING ARCH_SUFFIX " (GCC)]"
++#  endif
++#else
++#  if defined(_UCRT)
++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "GCC UCRT " __VERSION__ ARCH_SUFFIX "]"
++#  else
++#    define COMPILER COMP_SEP "[" ARCH_PREFIX "GCC " __VERSION__ ARCH_SUFFIX "]"
++#  endif
++#endif
++
+ // Generic fallbacks.
+ #elif defined(__cplusplus)
+ #define COMPILER "[C++]"

diff --git a/0036-build-fix-signal-module-build.patch b/0036-build-fix-signal-module-build.patch
new file mode 100644
index 0000000..6e40083
--- /dev/null
+++ b/0036-build-fix-signal-module-build.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.bootstrap.in Python-3.14.7-new/Modules/Setup.bootstrap.in
+--- Python-3.14.7/Modules/Setup.bootstrap.in	2026-09-22 09:06:35.334517829 +0200
++++ Python-3.14.7-new/Modules/Setup.bootstrap.in	2026-09-22 09:06:40.372981340 +0200
+@@ -9,7 +9,7 @@
+ atexit atexitmodule.c
+ faulthandler faulthandler.c
+ @MODULE_POSIXMODULE_NAME@ posixmodule.c
+-_signal signalmodule.c
++_signal signalmodule.c -lws2_32
+ _tracemalloc _tracemalloc.c
+ _suggestions _suggestions.c
+ # needs libm and on some platforms librt

diff --git a/0037-build-build-winconsoleio-and-_testconsole.patch b/0037-build-build-winconsoleio-and-_testconsole.patch
new file mode 100644
index 0000000..40d5adc
--- /dev/null
+++ b/0037-build-build-winconsoleio-and-_testconsole.patch
@@ -0,0 +1,34 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:39.433137095 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:40.664051248 +0200
+@@ -8723,6 +8723,7 @@ PY_STDLIB_MOD([_testmultiphase], [test "
+ PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
+ PY_STDLIB_MOD([xxsubtype], [test "$TEST_MODULES" = yes])
+ PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes])
++PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"])
+ dnl Check have_libffi so _ctypes_test is only built if _ctypes is built.
+ dnl _ctypes_test doesn't use libffi directly.
+ PY_STDLIB_MOD([_ctypes_test],
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.bootstrap.in Python-3.14.7-new/Modules/Setup.bootstrap.in
+--- Python-3.14.7/Modules/Setup.bootstrap.in	2026-09-22 09:06:40.659419496 +0200
++++ Python-3.14.7-new/Modules/Setup.bootstrap.in	2026-09-22 09:06:40.663114872 +0200
+@@ -19,7 +19,7 @@ _datetime _datetimemodule.c
+ _codecs _codecsmodule.c
+ _collections _collectionsmodule.c
+ errno errnomodule.c
+-_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
++_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c
+ itertools itertoolsmodule.c
+ _sre _sre/sre.c
+ _sysconfig _sysconfig.c
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.stdlib.in Python-3.14.7-new/Modules/Setup.stdlib.in
+--- Python-3.14.7/Modules/Setup.stdlib.in	2026-09-22 09:06:35.334732057 +0200
++++ Python-3.14.7-new/Modules/Setup.stdlib.in	2026-09-22 09:06:40.663385827 +0200
+@@ -192,6 +192,7 @@
+ @MODULE__TESTMULTIPHASE_TRUE@_testmultiphase _testmultiphase.c
+ @MODULE__TESTSINGLEPHASE_TRUE@_testsinglephase _testsinglephase.c
+ @MODULE__CTYPES_TEST_TRUE@_ctypes_test _ctypes/_ctypes_test.c
++@MODULE__TESTCONSOLE_TRUE@_testconsole ../PC/_testconsole.c
+ 
+ # Limited API template modules; must be built as shared modules.
+ @MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c

diff --git a/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch b/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch
new file mode 100644
index 0000000..11d6c44
--- /dev/null
+++ b/0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_multiprocessing/multiprocessing.c Python-3.14.7-new/Modules/_multiprocessing/multiprocessing.c
+--- Python-3.14.7/Modules/_multiprocessing/multiprocessing.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_multiprocessing/multiprocessing.c	2026-09-22 09:06:40.959508513 +0200
+@@ -181,7 +181,7 @@ static PyMethodDef module_methods[] = {
+     _MULTIPROCESSING_RECV_METHODDEF
+     _MULTIPROCESSING_SEND_METHODDEF
+ #endif
+-#if !defined(POSIX_SEMAPHORES_NOT_ENABLED)
++#if defined(MS_WINDOWS) || !defined(POSIX_SEMAPHORES_NOT_ENABLED)
+     _MULTIPROCESSING_SEM_UNLINK_METHODDEF
+ #endif
+     {NULL}

diff --git a/0039-build-link-win-resource-files-and-build-pythonw.patch b/0039-build-link-win-resource-files-and-build-pythonw.patch
new file mode 100644
index 0000000..be2ea36
--- /dev/null
+++ b/0039-build-link-win-resource-files-and-build-pythonw.patch
@@ -0,0 +1,154 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:40.953031093 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:41.261009614 +0200
+@@ -1784,6 +1784,10 @@ AC_SUBST([LINK_PYTHON_OBJS])
+ AC_SUBST([AR])
+ AC_CHECK_TOOLS([AR], [ar aal], [ar])
+ 
++# windres program
++AC_SUBST(WINDRES)
++AC_CHECK_TOOL(WINDRES, windres)
++
+ # tweak ARFLAGS only if the user didn't set it on the command line
+ AC_SUBST([ARFLAGS])
+ if test -z "$ARFLAGS"
+@@ -7714,10 +7718,33 @@ AC_MSG_RESULT([done])
+ case $host in
+   *-*-mingw*)
+     LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt"
++    AC_PROG_AWK
++    if test "$AWK" = "gawk"; then
++      awk_extra_flag="--non-decimal-data"
++    fi
++    AC_MSG_CHECKING([FIELD3])
++    FIELD3=$($AWK $awk_extra_flag '\
++      /^#define PY_RELEASE_LEVEL_/             {levels[$2]=$3}    \
++      /^#define PY_MICRO_VERSION[[:space:]]+/  {micro=$3}         \
++      /^#define PY_RELEASE_LEVEL[[:space:]]+/  {level=levels[$3]} \
++      /^#define PY_RELEASE_SERIAL[[:space:]]+/ {serial=$3}        \
++      END {print micro * 1000 + level * 10 + serial}' \
++      $srcdir/Include/patchlevel.h
++    )
++    
++    AC_MSG_RESULT([${FIELD3}])
++    RCFLAGS="$RCFLAGS -DFIELD3=$FIELD3 -O COFF"
++
++    case $host in
++      i686*)  RCFLAGS="$RCFLAGS --target=pe-i386" ;;
++      x86_64*)  RCFLAGS="$RCFLAGS --target=pe-x86-64" ;;
++      *) ;;
++    esac
+   ;;
+   *)
+   ;;
+ esac
++AC_SUBST(RCFLAGS)
+ 
+ # Availability of -O2:
+ AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:38.529200138 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:41.260009683 +0200
+@@ -38,6 +38,7 @@ CC=		@CC@
+ CXX=		@CXX@
+ LINKCC=		@LINKCC@
+ AR=		@AR@
++WINDRES=	@WINDRES@
+ READELF=	@READELF@
+ SOABI=		@SOABI@
+ ABIFLAGS=	@ABIFLAGS@
+@@ -128,6 +129,7 @@ PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLA
+ CFLAGS_ALIASING=@CFLAGS_ALIASING@
+ # Compilation flags only for ceval.c.
+ CFLAGS_CEVAL=@CFLAGS_CEVAL@
++RCFLAGS=@RCFLAGS@
+ 
+ 
+ # Machine-dependent subdirectories
+@@ -312,6 +314,7 @@ LIBOBJS=	@LIBOBJS@
+ 
+ PYTHON=		python$(EXE)
+ BUILDPYTHON=	python$(BUILDEXE)
++BUILDPYTHONW=	pythonw$(BUILDEXE)
+ 
+ HOSTRUNNER= @HOSTRUNNER@
+ 
+@@ -809,7 +812,7 @@ list-targets:
+ 	@grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}'
+ 
+ .PHONY: build_all
+-build_all:	check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \
++build_all:	check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \
+ 		gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json
+ 
+ .PHONY: build_wasm
+@@ -993,9 +996,21 @@ clinic: check-clean-src
+ clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c
+ 	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $(srcdir)/Lib/test/clinic.test.c
+ 
++python_exe.o: $(srcdir)/PC/python_exe.rc
++	$(WINDRES) $(RCFLAGS) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_exe.rc $@
++
++pythonw_exe.o: $(srcdir)/PC/pythonw_exe.rc
++	$(WINDRES) $(RCFLAGS) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pythonw_exe.rc $@
++
++python_nt.o: $(srcdir)/PC/python_nt.rc
++	$(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@
++
++$(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw_exe.o
++	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -mwindows -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) pythonw_exe.o
++
+ # Build the interpreter
+-$(BUILDPYTHON):	Programs/python.o $(LINK_PYTHON_DEPS)
+-	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
++$(BUILDPYTHON):	Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o
++	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
+ 
+ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
+@@ -1099,10 +1114,10 @@ $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
+ 
+ # This rule builds the Cygwin Python DLL and import library if configured
+ # for a shared core library; otherwise, this rule is a noop.
+-$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
++$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o
+ 	if test -n "$(DLLLIBRARY)"; then \
+ 		$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
+-			$(LIBS) $(MODLIBS) $(SYSLIBS); \
++			$(LIBS) $(LDFLAGS_NODIST) $(MODLIBS) $(SYSLIBS); \
+ 	else true; \
+ 	fi
+ 
+@@ -2448,6 +2463,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
+ 	done
+ 	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
++		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
++		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \
+ 	else \
+ 		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+ 	fi
+diff -rupN --no-dereference Python-3.14.7/PC/python_exe.rc Python-3.14.7-new/PC/python_exe.rc
+--- Python-3.14.7/PC/python_exe.rc	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/python_exe.rc	2026-09-22 09:06:41.260806196 +0200
+@@ -12,7 +12,7 @@
+ // current versions of Windows.
+ 1 RT_MANIFEST "python.manifest"
+ 
+-1 ICON DISCARDABLE "icons\python.ico" 
++1 ICON DISCARDABLE "icons/python.ico" 
+ 
+ 
+ /////////////////////////////////////////////////////////////////////////////
+diff -rupN --no-dereference Python-3.14.7/PC/pythonw_exe.rc Python-3.14.7-new/PC/pythonw_exe.rc
+--- Python-3.14.7/PC/pythonw_exe.rc	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/pythonw_exe.rc	2026-09-22 09:06:41.260945966 +0200
+@@ -12,7 +12,7 @@
+ // current versions of Windows.
+ 1 RT_MANIFEST "python.manifest"
+ 
+-1 ICON DISCARDABLE "icons\pythonw.ico" 
++1 ICON DISCARDABLE "icons/pythonw.ico" 
+ 
+ 
+ /////////////////////////////////////////////////////////////////////////////

diff --git a/0040-pycore_fileutils-add-MINGW-support.patch b/0040-pycore_fileutils-add-MINGW-support.patch
new file mode 100644
index 0000000..d9ff5cf
--- /dev/null
+++ b/0040-pycore_fileutils-add-MINGW-support.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Include/internal/pycore_fileutils.h Python-3.14.7-new/Include/internal/pycore_fileutils.h
+--- Python-3.14.7/Include/internal/pycore_fileutils.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/internal/pycore_fileutils.h	2026-09-22 09:06:41.560674473 +0200
+@@ -13,7 +13,7 @@ extern "C" {
+ 
+ 
+ /* A routine to check if a file descriptor can be select()-ed. */
+-#ifdef _MSC_VER
++#ifdef MS_WINDOWS
+     /* On Windows, any socket fd can be select()-ed, no matter how high */
+     #define _PyIsSelectable_fd(FD) (1)
+ #else

diff --git a/0041-configure-fix-inet_pton-check.patch b/0041-configure-fix-inet_pton-check.patch
new file mode 100644
index 0000000..62257ce
--- /dev/null
+++ b/0041-configure-fix-inet_pton-check.patch
@@ -0,0 +1,18 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:41.554989110 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:41.849968537 +0200
+@@ -5856,10 +5856,14 @@ PY_CHECK_NETDB_FUNC([getprotobyname])
+ 
+ dnl PY_CHECK_SOCKET_FUNC(FUNCTION)
+ AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [
++#ifdef _WIN32
++#include <ws2tcpip.h>
++#else
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#endif
+ ])])
+ 
+ PY_CHECK_SOCKET_FUNC([inet_aton])

diff --git a/0042-importlib-bootstrap-path-sep.patch b/0042-importlib-bootstrap-path-sep.patch
new file mode 100644
index 0000000..601eda7
--- /dev/null
+++ b/0042-importlib-bootstrap-path-sep.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/importlib/_bootstrap_external.py Python-3.14.7-new/Lib/importlib/_bootstrap_external.py
+--- Python-3.14.7/Lib/importlib/_bootstrap_external.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/importlib/_bootstrap_external.py	2026-09-22 09:06:42.142124034 +0200
+@@ -42,6 +42,10 @@ if _MS_WINDOWS:
+     path_separators = ['\\', '/']
+ else:
+     path_separators = ['/']
++
++if sys._use_alt_sep:
++    path_separators = path_separators[::-1]
++
+ # Assumption made in _path_join()
+ assert all(len(sep) == 1 for sep in path_separators)
+ path_sep = path_separators[0]

diff --git a/0043-configure-set-MINGW-stack-reserve.patch b/0043-configure-set-MINGW-stack-reserve.patch
new file mode 100644
index 0000000..762dbb6
--- /dev/null
+++ b/0043-configure-set-MINGW-stack-reserve.patch
@@ -0,0 +1,15 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:42.136948522 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:42.432927879 +0200
+@@ -3912,6 +3912,11 @@ then
+ 	VxWorks*)
+ 		LINKFORSHARED='-Wl,-export-dynamic';;
+ 	esac
++	case $host in
++	*-*-mingw*)
++		# for https://bugs.python.org/issue40458 on MINGW
++		LINKFORSHARED="-Wl,--stack,4194304";;
++	esac
+ fi
+ AC_MSG_RESULT([$LINKFORSHARED])
+ 

diff --git a/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch b/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch
deleted file mode 100644
index 098c8af..0000000
--- a/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: "Jason R. Coombs" <jaraco@jaraco.com>
-Date: Mon, 19 Aug 2024 19:28:20 -0400
-Subject: [PATCH] 00436: [CVE-2024-8088] gh-122905: Sanitize names in
- zipfile.Path.
-
-Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
----
- Lib/test/test_zipfile.py                      | 17 ++++++
- Lib/zipfile.py                                | 61 ++++++++++++++++++-
- ...-08-11-14-08-04.gh-issue-122905.7tDsxA.rst |  1 +
- 3 files changed, 78 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst
-
-diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
-index 4de6f379a4..8bdc7a1b7d 100644
---- a/Lib/test/test_zipfile.py
-+++ b/Lib/test/test_zipfile.py
-@@ -3651,6 +3651,23 @@ def test_extract_orig_with_implied_dirs(self, alpharep):
-         zipfile.Path(zf)
-         zf.extractall(source_path.parent)
- 
-+    def test_malformed_paths(self):
-+        """
-+        Path should handle malformed paths.
-+        """
-+        data = io.BytesIO()
-+        zf = zipfile.ZipFile(data, "w")
-+        zf.writestr("/one-slash.txt", b"content")
-+        zf.writestr("//two-slash.txt", b"content")
-+        zf.writestr("../parent.txt", b"content")
-+        zf.filename = ''
-+        root = zipfile.Path(zf)
-+        assert list(map(str, root.iterdir())) == [
-+            'one-slash.txt',
-+            'two-slash.txt',
-+            'parent.txt',
-+        ]
-+
- 
- class EncodedMetadataTests(unittest.TestCase):
-     file_names = ['\u4e00', '\u4e8c', '\u4e09']  # Han 'one', 'two', 'three'
-diff --git a/Lib/zipfile.py b/Lib/zipfile.py
-index 86829abce4..b7bf9ef7e3 100644
---- a/Lib/zipfile.py
-+++ b/Lib/zipfile.py
-@@ -9,6 +9,7 @@
- import itertools
- import os
- import posixpath
-+import re
- import shutil
- import stat
- import struct
-@@ -2243,7 +2244,65 @@ def _difference(minuend, subtrahend):
-     return itertools.filterfalse(set(subtrahend).__contains__, minuend)
- 
- 
--class CompleteDirs(ZipFile):
-+class SanitizedNames:
-+    """
-+    ZipFile mix-in to ensure names are sanitized.
-+    """
-+
-+    def namelist(self):
-+        return list(map(self._sanitize, super().namelist()))
-+
-+    @staticmethod
-+    def _sanitize(name):
-+        r"""
-+        Ensure a relative path with posix separators and no dot names.
-+        Modeled after
-+        https://github.com/python/cpython/blob/bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c/Lib/zipfile/__init__.py#L1799-L1813
-+        but provides consistent cross-platform behavior.
-+        >>> san = SanitizedNames._sanitize
-+        >>> san('/foo/bar')
-+        'foo/bar'
-+        >>> san('//foo.txt')
-+        'foo.txt'
-+        >>> san('foo/.././bar.txt')
-+        'foo/bar.txt'
-+        >>> san('foo../.bar.txt')
-+        'foo../.bar.txt'
-+        >>> san('\\foo\\bar.txt')
-+        'foo/bar.txt'
-+        >>> san('D:\\foo.txt')
-+        'D/foo.txt'
-+        >>> san('\\\\server\\share\\file.txt')
-+        'server/share/file.txt'
-+        >>> san('\\\\?\\GLOBALROOT\\Volume3')
-+        '?/GLOBALROOT/Volume3'
-+        >>> san('\\\\.\\PhysicalDrive1\\root')
-+        'PhysicalDrive1/root'
-+        Retain any trailing slash.
-+        >>> san('abc/')
-+        'abc/'
-+        Raises a ValueError if the result is empty.
-+        >>> san('../..')
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Empty filename
-+        """
-+
-+        def allowed(part):
-+            return part and part not in {'..', '.'}
-+
-+        # Remove the drive letter.
-+        # Don't use ntpath.splitdrive, because that also strips UNC paths
-+        bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE)
-+        clean = bare.replace('\\', '/')
-+        parts = clean.split('/')
-+        joined = '/'.join(filter(allowed, parts))
-+        if not joined:
-+            raise ValueError("Empty filename")
-+        return joined + '/' * name.endswith('/')
-+
-+
-+class CompleteDirs(SanitizedNames, ZipFile):
-     """
-     A ZipFile subclass that ensures that implied directories
-     are always included in the namelist.
-diff --git a/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst
-new file mode 100644
-index 0000000000..1be44c906c
---- /dev/null
-+++ b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst
-@@ -0,0 +1 @@
-+:class:`zipfile.Path` objects now sanitize names from the zipfile.

diff --git a/0044-tests-fix-test_bytes.patch b/0044-tests-fix-test_bytes.patch
new file mode 100644
index 0000000..1ceb110
--- /dev/null
+++ b/0044-tests-fix-test_bytes.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_bytes.py Python-3.14.7-new/Lib/test/test_bytes.py
+--- Python-3.14.7/Lib/test/test_bytes.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_bytes.py	2026-09-22 09:06:42.733906887 +0200
+@@ -1245,7 +1245,7 @@ class BytesTest(BaseBytesTest, unittest.
+ 
+         if os.name == 'nt':
+             # Windows (MSCRT)
+-            ptr_format = '0x%0{}X'.format(2 * sizeof_ptr)
++            ptr_format = '0x%0{}x'.format(2 * sizeof_ptr)
+             def ptr_formatter(ptr):
+                 return (ptr_format % ptr)
+         else:

diff --git a/0045-timemodule-add-MINGW-support.patch b/0045-timemodule-add-MINGW-support.patch
new file mode 100644
index 0000000..c60d0d0
--- /dev/null
+++ b/0045-timemodule-add-MINGW-support.patch
@@ -0,0 +1,21 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/timemodule.c Python-3.14.7-new/Modules/timemodule.c
+--- Python-3.14.7/Modules/timemodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/timemodule.c	2026-09-22 09:06:43.028681297 +0200
+@@ -41,7 +41,7 @@
+ #  include <sanitizer/msan_interface.h>
+ #endif
+ 
+-#ifdef _MSC_VER
++#ifdef MS_WINDOWS
+ #  define _Py_timezone _timezone
+ #  define _Py_daylight _daylight
+ #  define _Py_tzname _tzname
+@@ -898,7 +898,7 @@ time_strftime(PyObject *module, PyObject
+ //
+ // Android works with negative years on the emulator, but fails on some
+ // physical devices (#123017).
+-#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) \
++#if defined(MS_WINDOWS) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) \
+     || defined(__VXWORKS__) || defined(__ANDROID__)
+     if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
+         PyErr_SetString(PyExc_ValueError,

diff --git a/0046-configure-Disable-checks-for-dlopen-dlfcn.patch b/0046-configure-Disable-checks-for-dlopen-dlfcn.patch
new file mode 100644
index 0000000..1497534
--- /dev/null
+++ b/0046-configure-Disable-checks-for-dlopen-dlfcn.patch
@@ -0,0 +1,51 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:42.728907235 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:43.330865251 +0200
+@@ -3224,7 +3224,7 @@ AC_DEFINE([STDC_HEADERS], [1],
+ 
+ # checks for header files
+ AC_CHECK_HEADERS([ \
+-  alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
++  alloca.h asm/types.h bluetooth.h conio.h direct.h endian.h errno.h fcntl.h grp.h \
+   io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
+   linux/netfilter_ipv4.h linux/random.h linux/soundcard.h linux/sched.h \
+   linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pty.h \
+@@ -3237,6 +3237,12 @@ AC_CHECK_HEADERS([ \
+   sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h sys/xattr.h sysexits.h syslog.h \
+   termios.h util.h utime.h utmp.h \
+ ])
++
++case $host in
++  *-*-mingw*) ;;
++  *) AC_CHECK_HEADERS([dlfcn.h]);;
++esac
++
+ AC_HEADER_DIRENT
+ AC_HEADER_MAJOR
+ 
+@@ -3981,7 +3987,12 @@ AC_SUBST([PERF_TRAMPOLINE_OBJ])
+ 
+ # checks for libraries
+ AC_CHECK_LIB([sendfile], [sendfile])
+-AC_CHECK_LIB([dl], [dlopen])       # Dynamic linking for SunOS/Solaris and SYSV
++
++case $host in
++  *-*-mingw*) ;;
++  *) AC_CHECK_LIB([dl], [dlopen]) ;;	# Dynamic linking for SunOS/Solaris and SYSV
++esac
++
+ AC_CHECK_LIB([dld], [shl_load])    # Dynamic linking for HP-UX
+ 
+ 
+@@ -6595,7 +6606,10 @@ AS_VAR_IF([ac_cv_broken_sem_getvalue], [
+   )
+ ])
+ 
+-AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND, RTLD_MEMBER], [], [], [[@%:@include <dlfcn.h>]])
++case $host in
++  *-*-mingw*) ;;
++  *) AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND, RTLD_MEMBER], [], [], [[@%:@include <dlfcn.h>]])
++esac
+ 
+ # determine what size digit to use for Python's longs
+ AC_MSG_CHECKING([digit size for Python's longs])

diff --git a/0047-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch b/0047-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch
new file mode 100644
index 0000000..c5e8e69
--- /dev/null
+++ b/0047-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch
@@ -0,0 +1,167 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:41.556010858 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:43.637536832 +0200
+@@ -179,6 +179,7 @@ BINLIBDEST=	@BINLIBDEST@
+ LIBDEST=	$(SCRIPTDIR)/python$(VERSION)$(ABI_THREAD)
+ INCLUDEPY=	$(INCLUDEDIR)/python$(LDVERSION)
+ CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(LDVERSION)
++VENVLAUNCHERDIR=	$(BINLIBDEST)/venv/scripts/nt
+ 
+ # Symbols used for using shared libraries
+ SHLIB_SUFFIX=	@SHLIB_SUFFIX@
+@@ -315,6 +316,8 @@ LIBOBJS=	@LIBOBJS@
+ PYTHON=		python$(EXE)
+ BUILDPYTHON=	python$(BUILDEXE)
+ BUILDPYTHONW=	pythonw$(BUILDEXE)
++BUILDVENVLAUNCHER=	venvlauncher$(BUILDEXE)
++BUILDVENVWLAUNCHER=	venvwlauncher$(BUILDEXE)
+ 
+ HOSTRUNNER= @HOSTRUNNER@
+ 
+@@ -812,7 +815,7 @@ list-targets:
+ 	@grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}'
+ 
+ .PHONY: build_all
+-build_all:	check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) platform sharedmods \
++build_all:	check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \
+ 		gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json
+ 
+ .PHONY: build_wasm
+@@ -1005,6 +1008,12 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.
+ python_nt.o: $(srcdir)/PC/python_nt.rc
+ 	$(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@
+ 
++venvlauncher.o: $(srcdir)/PC/pylauncher.rc
++	$(WINDRES) $(RCFLAGS) -DPY_ICON -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pylauncher.rc $@
++
++venvwlauncher.o: $(srcdir)/PC/pylauncher.rc
++	$(WINDRES) $(RCFLAGS) -DPYW_ICON -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pylauncher.rc $@
++
+ $(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw_exe.o
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -mwindows -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) pythonw_exe.o
+ 
+@@ -1012,6 +1021,12 @@ $(BUILDPYTHONW): Programs/python.o $(LIB
+ $(BUILDPYTHON):	Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
+ 
++$(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o  $(srcdir)/PC/launcher.c
++	$(LINKCC) -D_CONSOLE -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
++
++$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) venvwlauncher.o  $(srcdir)/PC/launcher.c
++	$(LINKCC) -D_WINDOWS -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
++
+ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
+ 
+@@ -2453,7 +2468,7 @@ sharedinstall: all
+ # This goes into $(exec_prefix)
+ .PHONY: altbininstall
+ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
+-	@for i in $(BINDIR) $(LIBDIR); \
++	@for i in $(BINDIR) $(LIBDIR) $(VENVLAUNCHERDIR); \
+ 	do \
+ 		if test ! -d $(DESTDIR)$$i; then \
+ 			echo "Creating directory $$i"; \
+@@ -2465,6 +2480,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \
++		$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVLAUNCHER); \
++		$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVWLAUNCHER); \
+ 	else \
+ 		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+ 	fi
+@@ -2613,7 +2630,7 @@ LIBSUBDIRS=	asyncio \
+ 		turtledemo \
+ 		unittest \
+ 		urllib \
+-		venv venv/scripts venv/scripts/common venv/scripts/posix \
++		venv venv/scripts venv/scripts/common venv/scripts/posix venv/scripts/nt \
+ 		wsgiref \
+ 		$(XMLLIBSUBDIRS) \
+ 		xmlrpc \
+diff -rupN --no-dereference Python-3.14.7/PC/launcher.c Python-3.14.7-new/PC/launcher.c
+--- Python-3.14.7/PC/launcher.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/launcher.c	2026-09-22 09:06:43.638084636 +0200
+@@ -924,7 +924,7 @@ static COMMAND path_command;
+ static COMMAND * find_on_path(wchar_t * name)
+ {
+     wchar_t * pathext;
+-    size_t    varsize;
++    size_t    requiredSize;
+     wchar_t * context = NULL;
+     wchar_t * extension;
+     COMMAND * result = NULL;
+@@ -941,18 +941,23 @@ static COMMAND * find_on_path(wchar_t *
+     }
+     else {
+         /* No extension - search using registered extensions. */
+-        rc = _wdupenv_s(&pathext, &varsize, L"PATHEXT");
+-        if (rc == 0) {
+-            extension = wcstok_s(pathext, L";", &context);
+-            while (extension) {
+-                len = SearchPathW(NULL, name, extension, MSGSIZE, path_command.value, NULL);
+-                if (len) {
+-                    result = &path_command;
+-                    break;
++        _wgetenv_s(&requiredSize, NULL, 0, L"PATHEXT");
++        if (requiredSize > 0) {
++            pathext = (wchar_t *)malloc(requiredSize * sizeof(wchar_t));
++            /* No extension - search using registered extensions. */
++            rc = _wgetenv_s(&requiredSize, pathext, requiredSize, L"PATHEXT");
++            if (rc == 0) {
++                extension = wcstok_s(pathext, L";", &context);
++                while (extension) {
++                    len = SearchPathW(NULL, name, extension, MSGSIZE, path_command.value, NULL);
++                    if (len) {
++                        result = &path_command;
++                        break;
++                    }
++                    extension = wcstok_s(NULL, L";", &context);
+                 }
+-                extension = wcstok_s(NULL, L";", &context);
++                free(pathext);
+             }
+-            free(pathext);
+         }
+     }
+     return result;
+@@ -1914,7 +1919,7 @@ process(int argc, wchar_t ** argv)
+         if (_wfopen_s(&f, venv_cfg_path, L"r")) {
+             error(RC_BAD_VENV_CFG, L"Cannot read '%ls'", venv_cfg_path);
+         }
+-        cb = fread_s(buffer, sizeof(buffer), sizeof(buffer[0]),
++        cb = fread(buffer, sizeof(buffer[0]),
+                      sizeof(buffer) / sizeof(buffer[0]), f);
+         fclose(f);
+ 
+diff -rupN --no-dereference Python-3.14.7/PC/pylauncher.rc Python-3.14.7-new/PC/pylauncher.rc
+--- Python-3.14.7/PC/pylauncher.rc	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/pylauncher.rc	2026-09-22 09:06:43.638444185 +0200
+@@ -12,17 +12,17 @@
+ 1 RT_MANIFEST "python.manifest"
+ 
+ #if defined(PY_ICON)
+-1 ICON DISCARDABLE "icons\python.ico"
++1 ICON DISCARDABLE "icons/python.ico"
+ #elif defined(PYW_ICON)
+-1 ICON DISCARDABLE "icons\pythonw.ico"
++1 ICON DISCARDABLE "icons/pythonw.ico"
+ #else
+-1 ICON DISCARDABLE "icons\launcher.ico" 
+-2 ICON DISCARDABLE "icons\py.ico" 
+-3 ICON DISCARDABLE "icons\pyc.ico" 
+-4 ICON DISCARDABLE "icons\pyd.ico" 
+-5 ICON DISCARDABLE "icons\python.ico"
+-6 ICON DISCARDABLE "icons\pythonw.ico"
+-7 ICON DISCARDABLE "icons\setup.ico" 
++1 ICON DISCARDABLE "icons/launcher.ico"
++2 ICON DISCARDABLE "icons/py.ico" 
++3 ICON DISCARDABLE "icons/pyc.ico" 
++4 ICON DISCARDABLE "icons/pyd.ico" 
++5 ICON DISCARDABLE "icons/python.ico"
++6 ICON DISCARDABLE "icons/pythonw.ico"
++7 ICON DISCARDABLE "icons/setup.ico" 
+ #endif
+ 
+ 1 USAGE "launcher-usage.txt"

diff --git a/0048-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch b/0048-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
new file mode 100644
index 0000000..880b631
--- /dev/null
+++ b/0048-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
@@ -0,0 +1,54 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:43.930920628 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:43.935952299 +0200
+@@ -1022,10 +1022,10 @@ $(BUILDPYTHON):	Programs/python.o $(LINK
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
+ 
+ $(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o  $(srcdir)/PC/launcher.c
+-	$(LINKCC) -D_CONSOLE -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
++	$(LINKCC) -D_CONSOLE -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"python$(LDVERSION)$(EXE)\"" $(PY_STDMODULE_CFLAGS) -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
+ 
+ $(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) venvwlauncher.o  $(srcdir)/PC/launcher.c
+-	$(LINKCC) -D_WINDOWS -DVENV_REDIRECT $(PY_STDMODULE_CFLAGS) -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
++	$(LINKCC) -D_WINDOWS -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"pythonw$(LDVERSION)$(EXE)\"" $(PY_STDMODULE_CFLAGS) -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
+ 
+ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
+diff -rupN --no-dereference Python-3.14.7/PC/launcher.c Python-3.14.7-new/PC/launcher.c
+--- Python-3.14.7/PC/launcher.c	2026-09-22 09:06:43.931629211 +0200
++++ Python-3.14.7-new/PC/launcher.c	2026-09-22 09:06:43.936496524 +0200
+@@ -1932,7 +1932,8 @@ process(int argc, wchar_t ** argv)
+         if (!cch) {
+             error(0, L"Cannot determine memory for home path");
+         }
+-        cch += (DWORD)wcslen(PYTHON_EXECUTABLE) + 4; /* include sep, null and quotes */
++        cch += (DWORD)max(wcslen(PYTHON_EXECUTABLE_WITH_VERSION),
++                          wcslen(PYTHON_EXECUTABLE)) + 4; /* include sep, null and quotes */
+         executable = (wchar_t *)malloc(cch * sizeof(wchar_t));
+         if (executable == NULL) {
+             error(RC_NO_MEMORY, L"A memory allocation failed");
+@@ -1950,13 +1951,22 @@ process(int argc, wchar_t ** argv)
+             executable[cch_actual++] = L'\\';
+             executable[cch_actual] = L'\0';
+         }
+-        if (wcscat_s(&executable[1], cch - 1, PYTHON_EXECUTABLE)) {
++        if (wcscat_s(&executable[1], cch - 1, PYTHON_EXECUTABLE_WITH_VERSION)) {
+             error(RC_BAD_VENV_CFG, L"Cannot create executable path from '%ls'",
+                   venv_cfg_path);
+         }
+         /* there's no trailing quote, so we only have to skip one character for the test */
++        // Check if the versioned executable (PYTHON_EXECUTABLE_WITH_VERSION) exists first
+         if (GetFileAttributesW(&executable[1]) == INVALID_FILE_ATTRIBUTES) {
+-            error(RC_NO_PYTHON, L"No Python at '%ls'", executable);
++            // If not found, try PYTHON_EXECUTABLE
++            executable[cch_actual] = L'\0';  // Reset the path
++            if (wcscat_s(&executable[1], cch - 1, PYTHON_EXECUTABLE)) {
++                error(RC_BAD_VENV_CFG, L"Cannot create executable path from '%ls'",
++                      venv_cfg_path);
++            }
++            if (GetFileAttributesW(&executable[1]) == INVALID_FILE_ATTRIBUTES) {
++                error(RC_NO_PYTHON, L"No Python at '%ls'", executable);
++            }
+         }
+         /* now append the final quote */
+         wcscat_s(executable, cch, L"\"");

diff --git a/0049-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch b/0049-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch
new file mode 100644
index 0000000..e4fcfe7
--- /dev/null
+++ b/0049-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch
@@ -0,0 +1,19 @@
+diff -rupN --no-dereference Python-3.14.7/PC/launcher.c Python-3.14.7-new/PC/launcher.c
+--- Python-3.14.7/PC/launcher.c	2026-09-22 09:06:44.229311574 +0200
++++ Python-3.14.7-new/PC/launcher.c	2026-09-22 09:06:44.232802345 +0200
+@@ -499,6 +499,7 @@ locate_all_pythons(void)
+ {
+     /* venv Python is highest priority */
+     locate_venv_python();
++#ifndef __MINGW32__
+ #if defined(_M_X64)
+     /* If we are a 64bit process, first hit the 32bit keys. */
+     debug(L"locating Pythons in 32bit registry\n");
+@@ -519,6 +520,7 @@ locate_all_pythons(void)
+     locate_pythons_for_key(HKEY_LOCAL_MACHINE, KEY_READ);
+     /* Store-installed Python is lowest priority */
+     locate_store_pythons();
++#endif
+     qsort(installed_pythons, num_installed_pythons, sizeof(INSTALLED_PYTHON),
+           compare_pythons);
+ }

diff --git a/0050-configure-don-t-check-for-clock_-functions.patch b/0050-configure-don-t-check-for-clock_-functions.patch
new file mode 100644
index 0000000..a436030
--- /dev/null
+++ b/0050-configure-don-t-check-for-clock_-functions.patch
@@ -0,0 +1,22 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:43.632844190 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:44.528781701 +0200
+@@ -5955,6 +5955,9 @@ AC_CHECK_FUNCS([setpgrp],
+ # check for namespace functions
+ AC_CHECK_FUNCS([setns unshare])
+ 
++case $host in
++  *-*-mingw*) ;;
++  *)
+ AC_CHECK_FUNCS([clock_gettime], [], [
+     AC_CHECK_LIB([rt], [clock_gettime], [
+         LIBS="$LIBS -lrt"
+@@ -5981,6 +5984,8 @@ then
+       ])
+   ])
+ fi
++  ;;
++esac
+ 
+ # On Android before API level 23, clock_nanosleep returns the wrong value when
+ # interrupted by a signal (https://issuetracker.google.com/issues/216495770).

diff --git a/0051-CI-test-the-build-and-add-some-mingw-specific-tests.patch b/0051-CI-test-the-build-and-add-some-mingw-specific-tests.patch
new file mode 100644
index 0000000..a258a73
--- /dev/null
+++ b/0051-CI-test-the-build-and-add-some-mingw-specific-tests.patch
@@ -0,0 +1,427 @@
+diff -rupN --no-dereference Python-3.14.7/mingw_ignorefile_msvcrt.txt Python-3.14.7-new/mingw_ignorefile_msvcrt.txt
+--- Python-3.14.7/mingw_ignorefile_msvcrt.txt	1970-01-01 01:00:00.000000000 +0100
++++ Python-3.14.7-new/mingw_ignorefile_msvcrt.txt	2026-09-22 09:06:44.827249554 +0200
+@@ -0,0 +1,24 @@
++test.datetimetester.TestDate_Fast.*
++test.datetimetester.TestDate_Pure.*
++test.datetimetester.TestDateTime_Fast.*
++test.datetimetester.TestDateTime_Pure.*
++test.datetimetester.TestDateTimeTZ_Fast.*
++test.datetimetester.TestDateTimeTZ_Pure.*
++test.datetimetester.TestTime_Fast.*
++test.datetimetester.TestTime_Pure.*
++test.datetimetester.TestTimeTZ_Fast.*
++test.datetimetester.TestTimeTZ_Pure.*
++test.datetimetester.TestSubclassDateTime_Fast.*
++test.datetimetester.TestSubclassDateTime_Pure.*
++test.test_cmath.CMathTests.test_specific_values
++test.test_math.MathTests.*
++test.test_locale.TestRealLocales.test_setlocale_long_encoding
++test.test_math.FMATests.test_fma_infinities
++test.test_math.FMATests.test_fma_overflow
++test.test_math.FMATests.test_fma_zero_result
++test.test_math.FMATests.test_random
++test.test_strftime.Y1900Tests.test_y_before_1900
++test.test_strptime.CalculationTests.*
++test.test_strptime.StrptimeTests.test_weekday
++test.test_strptime.TimeRETests.test_compile
++test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date
+\ No newline at end of file
+diff -rupN --no-dereference Python-3.14.7/mingw_ignorefile.txt Python-3.14.7-new/mingw_ignorefile.txt
+--- Python-3.14.7/mingw_ignorefile.txt	1970-01-01 01:00:00.000000000 +0100
++++ Python-3.14.7-new/mingw_ignorefile.txt	2026-09-22 09:06:44.827124355 +0200
+@@ -0,0 +1,36 @@
++test.test_ctypes.test_loading.LoaderTest.test_load_dll_with_flags
++test.test_import.ImportTests.test_dll_dependency_import
++test.test_site.CommandLineTests.test_no_args
++test.test_site.HelperFunctionsTests.test_getsitepackages
++test.test_regrtest.ProgramsTestCase.test_pcbuild_rt
++test.test_regrtest.ProgramsTestCase.test_tools_buildbot_test
++test.test_venv.BasicTest.test_activate_shell_script_has_no_dos_newlines
++test.test_venv.BasicTest.test_defaults_with_pathlike
++test.test_venv.BasicTest.test_defaults_with_str_path
++test.test_venv.BasicTest.test_executable
++test.test_venv.BasicTest.test_executable_symlinks
++test.test_venv.BasicTest.test_failed_symlink
++test.test_venv.BasicTest.test_multiprocessing
++test.test_venv.BasicTest.test_multiprocessing_recursion
++test.test_venv.BasicTest.test_prefixes
++test.test_venv.BasicTest.test_special_chars_windows
++test.test_venv.BasicTest.test_symlinking
++test.test_venv.BasicTest.test_sysconfig
++test.test_venv.BasicTest.test_sysconfig_symlinks
++test.test_venv.BasicTest.test_unicode_in_batch_file
++test.test_venv.BasicTest.test_unoverwritable_fails
++test.test_venv.BasicTest.test_upgrade
++test.test_venv.BasicTest.test_upgrade_dependencies
++test.test_venv.BasicTest.test_venvwlauncher
++test.test_venv.BasicTest.test_activate_bat_prefixes_prompt_by_default
++test.test_venv.BasicTest.test_activate_bat_respects_disable_prompt
++test.test_venv.EnsurePipTest.test_explicit_no_pip
++test.test_venv.EnsurePipTest.test_no_pip_by_default
++test.test_multiprocessing_spawn.test_manager.WithManagerTestMyManager.*
++test.test_external_inspection.*
++test.test_capi.test_object.CAPITest.test_is_unique_temporary
++test.test_cmd_line.CmdLineTest.test_dump_path_config
++test.test_audit.AuditTest.test_sys_remote_exec
++test.test_remote_pdb.PdbAttachTestCase.test_attach_to_process_with_colors
++test.test_remote_pdb.PdbAttachTestCase.test_attach_to_process_without_colors
++test.test_sys.TestRemoteExec.*
+\ No newline at end of file
+diff -rupN --no-dereference Python-3.14.7/mingw_smoketests.py Python-3.14.7-new/mingw_smoketests.py
+--- Python-3.14.7/mingw_smoketests.py	1970-01-01 01:00:00.000000000 +0100
++++ Python-3.14.7-new/mingw_smoketests.py	2026-09-22 09:06:44.827443952 +0200
+@@ -0,0 +1,353 @@
++#!/usr/bin/env python3
++# Copyright 2017 Christoph Reiter
++#
++# Permission is hereby granted, free of charge, to any person obtaining
++# a copy of this software and associated documentation files (the
++# "Software"), to deal in the Software without restriction, including
++# without limitation the rights to use, copy, modify, merge, publish,
++# distribute, sublicense, and/or sell copies of the Software, and to
++# permit persons to whom the Software is furnished to do so, subject to
++# the following conditions:
++#
++# The above copyright notice and this permission notice shall be included
++# in all copies or substantial portions of the Software.
++#
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++
++"""The goal of this test suite is collect tests for update regressions
++and to test msys2 related modifications like for path handling.
++Feel free to extend.
++"""
++
++import sys
++import os
++import unittest
++import sysconfig
++
++if sys._use_alt_sep:
++    SEP = "/"
++else:
++    SEP = "\\"
++
++_UCRT = 'ucrt' in sysconfig.get_platform()
++
++
++class Tests(unittest.TestCase):
++
++    def test_zoneinfo(self):
++        # https://github.com/msys2-contrib/cpython-mingw/issues/32
++        import zoneinfo
++        self.assertTrue(any(os.path.exists(p) for p in zoneinfo.TZPATH))
++        zoneinfo.ZoneInfo("America/Sao_Paulo")
++
++    def test_userdir_path_sep(self):
++        # Make sure os.path and pathlib use the same path separators
++        from unittest import mock
++        from os.path import expanduser
++        from pathlib import Path
++
++        profiles = ["C:\\foo", "C:/foo"]
++        for profile in profiles:
++            with mock.patch.dict(os.environ, {"USERPROFILE": profile}):
++                self.assertEqual(expanduser("~"), os.path.normpath(expanduser("~")))
++                self.assertEqual(str(Path("~").expanduser()), expanduser("~"))
++                self.assertEqual(str(Path.home()), expanduser("~"))
++
++    def test_ctypes_find_library(self):
++        from ctypes.util import find_library
++        from ctypes import cdll
++        self.assertTrue(cdll.msvcrt)
++        if _UCRT:
++            self.assertIsNone(find_library('c'))
++        else:
++            self.assertEqual(find_library('c'), 'msvcrt.dll')
++
++    def test_ctypes_dlopen(self):
++        import ctypes
++        self.assertEqual(ctypes.RTLD_GLOBAL, 0)
++        self.assertEqual(ctypes.RTLD_GLOBAL,  ctypes.RTLD_LOCAL)
++        self.assertFalse(hasattr(sys, 'setdlopenflags'))
++        self.assertFalse(hasattr(sys, 'getdlopenflags'))
++        self.assertFalse([n for n in dir(os) if n.startswith("RTLD_")])
++
++    def test_time_no_unix_stuff(self):
++        import time
++        self.assertFalse([n for n in dir(time) if n.startswith("clock_")])
++        self.assertFalse([n for n in dir(time) if n.startswith("CLOCK_")])
++        self.assertFalse([n for n in dir(time) if n.startswith("pthread_")])
++        self.assertFalse(hasattr(time, 'tzset'))
++
++    def test_strftime(self):
++        import time
++        with self.assertRaises(ValueError):
++            time.strftime('%Y', (12345,) + (0,) * 8)
++
++    def test_sep(self):
++        self.assertEqual(os.sep, SEP)
++
++    def test_module_file_path(self):
++        import asyncio
++        import zlib
++        self.assertEqual(zlib.__file__, os.path.normpath(zlib.__file__))
++        self.assertEqual(asyncio.__file__, os.path.normpath(asyncio.__file__))
++
++    def test_importlib_frozen_path_sep(self):
++        import importlib._bootstrap_external
++        self.assertEqual(importlib._bootstrap_external.path_sep, SEP)
++
++    def test_os_commonpath(self):
++        self.assertEqual(
++            os.path.commonpath(
++                [os.path.join("C:", os.sep, "foo", "bar"),
++                 os.path.join("C:", os.sep, "foo")]),
++                 os.path.join("C:", os.sep, "foo"))
++
++    def test_pathlib(self):
++        import pathlib
++
++        p = pathlib.Path("foo") / pathlib.Path("foo")
++        self.assertEqual(str(p), os.path.normpath(p))
++
++    def test_modules_import(self):
++        import sqlite3
++        import ssl
++        import ctypes
++        import curses
++
++    def test_c_modules_import(self):
++        import _decimal
++
++    def test_socket_inet_ntop(self):
++        import socket
++        self.assertTrue(hasattr(socket, "inet_ntop"))
++
++    def test_socket_inet_pton(self):
++        import socket
++        self.assertTrue(hasattr(socket, "inet_pton"))
++
++    def test_multiprocessing_queue(self):
++        from multiprocessing import Queue
++        Queue(0)
++
++    #def test_socket_timout_normal_error(self):
++    #    import urllib.request
++    #    from urllib.error import URLError
++
++    #    try:
++    #        urllib.request.urlopen(
++    #            'http://localhost', timeout=0.0001).close()
++    #    except URLError:
++    #        pass
++
++    def test_threads(self):
++        from concurrent.futures import ThreadPoolExecutor
++
++        with ThreadPoolExecutor(1) as pool:
++            for res in pool.map(lambda *x: None, range(10000)):
++                pass
++
++    def test_sysconfig(self):
++        # This should be able to execute without exceptions
++        sysconfig.get_config_vars()
++
++    def test_sqlite_enable_load_extension(self):
++        # Make sure --enable-loadable-sqlite-extensions is used
++        import sqlite3
++        self.assertTrue(sqlite3.Connection.enable_load_extension)
++
++    def test_venv_creation(self):
++        import tempfile
++        import venv
++        import subprocess
++        import shutil
++        with tempfile.TemporaryDirectory() as tmp:
++            builder = venv.EnvBuilder()
++            builder.create(tmp)
++            abiflags = sysconfig.get_config_var('ABIFLAGS')
++            assert os.path.exists(os.path.join(tmp, "bin", "activate"))
++            assert os.path.exists(os.path.join(tmp, "bin", "python" + abiflags + ".exe"))
++            assert os.path.exists(os.path.join(tmp, "bin", "pythonw" + abiflags + ".exe"))
++            subprocess.check_call([shutil.which("bash.exe"), os.path.join(tmp, "bin", "activate")])
++
++            # This will not work in in-tree build
++            if not sysconfig.is_python_build():
++                op = subprocess.check_output(
++                    [
++                        os.path.join(tmp, "bin", "python" + abiflags + ".exe"),
++                        "-c",
++                        "print('Hello World')"
++                    ],
++                    cwd=tmp,
++                )
++                assert op.decode().strip() == "Hello World"
++
++    def test_has_mktime(self):
++        from time import mktime, gmtime
++        mktime(gmtime())
++
++    def test_platform_things(self):
++        import platform
++        import importlib.machinery
++        import tempfile
++        import venv
++        import subprocess
++        self.assertEqual(sys.implementation.name, "cpython")
++        self.assertEqual(sys.platform, "win32")
++        self.assertTrue(sysconfig.get_platform().startswith("mingw"))
++        soabi = sysconfig.get_config_var('SOABI')
++        self.assertTrue(soabi.startswith("cp" + f'{sys.version_info.major}{sys.version_info.minor}'))
++        ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
++        abiflags = sysconfig.get_config_var('ABIFLAGS')
++        self.assertTrue("." + soabi + "." in ext_suffix)
++        self.assertTrue(ext_suffix.endswith(".pyd"))
++        self.assertTrue("mingw" in ext_suffix)
++        self.assertEqual(sysconfig.get_config_var('SHLIB_SUFFIX'), ".pyd")
++        ext_suffixes = importlib.machinery.EXTENSION_SUFFIXES
++        self.assertTrue(ext_suffix in ext_suffixes)
++        untagged_ext = abiflags + '.pyd'
++        self.assertTrue(untagged_ext in ext_suffixes)
++        if sysconfig.get_platform().startswith('mingw_i686'):
++             self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-32')
++        elif sysconfig.get_platform().startswith('mingw_aarch64'):
++            self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm64')
++        elif sysconfig.get_platform().startswith('mingw_armv7'):
++            self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])) + '-arm32')
++        else:
++            self.assertEqual(sys.winver, ".".join(map(str, sys.version_info[:2])))
++        self.assertEqual(platform.python_implementation(), "CPython")
++        self.assertEqual(platform.system(), "Windows")
++        self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0)
++
++        with tempfile.TemporaryDirectory() as tmp:
++            builder = venv.EnvBuilder()
++            builder.create(tmp)
++            # This will not work in in-tree build
++            if not sysconfig.is_python_build():
++                op = subprocess.check_output(
++                    [
++                        os.path.join(tmp, "bin", 'python' + abiflags + '.exe'),
++                        "-c",
++                        "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
++                    ],
++                    cwd=tmp,
++                )
++                self.assertTrue(op.decode().strip().startswith(sys.base_prefix))
++
++    def test_sys_getpath(self):
++        # everything sourced from getpath.py
++
++        def assertNormpath(path):
++            self.assertEqual(path, os.path.normpath(path))
++
++        assertNormpath(sys.executable)
++        assertNormpath(sys._base_executable)
++        assertNormpath(sys.prefix)
++        assertNormpath(sys.base_prefix)
++        assertNormpath(sys.exec_prefix)
++        assertNormpath(sys.base_exec_prefix)
++        assertNormpath(sys.platlibdir)
++        assertNormpath(sys._stdlib_dir)
++        for p in sys.path:
++            assertNormpath(p)
++
++    def test_site(self):
++        import site
++
++        self.assertEqual(len(site.getsitepackages()), 1)
++
++    def test_c_ext_build(self):
++        import tempfile
++        import subprocess
++        import textwrap
++        import venv
++        from pathlib import Path
++
++        if sysconfig.is_python_build():
++            pydir = os.path.dirname(sys._base_executable).replace('\\', '/')
++            os.environ["LDFLAGS"] = "-L " + pydir
++
++        with tempfile.TemporaryDirectory() as tmppro:
++            builder = venv.EnvBuilder(with_pip=True)
++            builder.create(tmppro)
++            venv_exe = os.path.join(tmppro, "bin", os.path.basename(sys.executable))
++
++            with Path(tmppro, "setup.py").open("w") as f:
++                f.write(
++                    textwrap.dedent(
++                        """\
++                                    from setuptools import setup, Extension
++
++                                    setup(
++                                        name='cwrapper',
++                                        version='1.0',
++                                        ext_modules=[
++                                            Extension(
++                                                'cwrapper',
++                                                sources=['cwrapper.c']),
++                                        ],
++                                    )
++                                """
++                    )
++                )
++            with Path(tmppro, "cwrapper.c").open("w") as f:
++                f.write(
++                    textwrap.dedent(
++                        """\
++                                    #include <Python.h>
++                                    static PyObject *
++                                    helloworld(PyObject *self, PyObject *args)
++                                    {
++                                        printf("Hello World\\n");
++                                        Py_RETURN_NONE;
++                                    }
++                                    static PyMethodDef
++                                    myMethods[] = {
++                                        { "helloworld", helloworld, METH_NOARGS, "Prints Hello World" },
++                                        { NULL, NULL, 0, NULL }
++                                    };
++                                    static struct PyModuleDef cwrapper = {
++                                        PyModuleDef_HEAD_INIT,
++                                        "cwrapper",
++                                        "Test Module",
++                                        -1,
++                                        myMethods
++                                    };
++
++                                    PyMODINIT_FUNC
++                                    PyInit_cwrapper(void)
++                                    {
++                                        return PyModule_Create(&cwrapper);
++                                    }
++                                """
++                    )
++                )
++            subprocess.check_call(
++                [venv_exe, "-c", "import struct"],
++            )
++            subprocess.check_call(
++                [
++                    venv_exe,
++                    "-m",
++                    "pip",
++                    "install",
++                    tmppro,
++                ],
++            )
++            subprocess.check_call(
++                [venv_exe, "-c", "import cwrapper"],
++            )
++
++
++
++def suite():
++    return unittest.TestLoader().loadTestsFromName(__name__)
++
++
++if __name__ == '__main__':
++    unittest.main(defaultTest='suite')

diff --git a/0052-configure-Default-to-without-c-locale-coercion-on-Wi.patch b/0052-configure-Default-to-without-c-locale-coercion-on-Wi.patch
new file mode 100644
index 0000000..58f2e1b
--- /dev/null
+++ b/0052-configure-Default-to-without-c-locale-coercion-on-Wi.patch
@@ -0,0 +1,20 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:44.821761266 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:45.123858438 +0200
+@@ -5357,11 +5357,14 @@ AC_MSG_RESULT([$with_pymalloc])
+ AC_MSG_CHECKING([for --with-c-locale-coercion])
+ AC_ARG_WITH(
+   [c-locale-coercion],
+-  [AS_HELP_STRING([--with-c-locale-coercion], [enable C locale coercion to a UTF-8 based locale (default is yes)])])
++  [AS_HELP_STRING([--with-c-locale-coercion], [enable C locale coercion to a UTF-8 based locale (default is yes on Unix, no on Windows)])])
+ 
+ if test -z "$with_c_locale_coercion"
+ then
+-    with_c_locale_coercion="yes"
++    case $host in
++      *-*-mingw*) with_c_locale_coercion="no";;
++      *) with_c_locale_coercion="yes";;
++    esac
+ fi
+ if test "$with_c_locale_coercion" != "no"
+ then

diff --git a/0053-tests-Fix-some-failing-tests.patch b/0053-tests-Fix-some-failing-tests.patch
new file mode 100644
index 0000000..26e6d8e
--- /dev/null
+++ b/0053-tests-Fix-some-failing-tests.patch
@@ -0,0 +1,83 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_getpath.py Python-3.14.7-new/Lib/test/test_getpath.py
+--- Python-3.14.7/Lib/test/test_getpath.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_getpath.py	2026-09-22 09:06:45.412795188 +0200
+@@ -904,6 +904,7 @@ DEFAULT_NAMESPACE = dict(
+     ENV_PYTHONHOME="",
+     ENV_PYTHONEXECUTABLE="",
+     ENV___PYVENV_LAUNCHER__="",
++    ENV_MSYSTEM="",
+     argv0="",
+     py_setpath="",
+     real_executable="",
+@@ -943,6 +944,7 @@ class MockNTNamespace(dict):
+         self.update(DEFAULT_NAMESPACE)
+         self["config"] = DEFAULT_CONFIG.copy()
+         self["os_name"] = "nt"
++        self["is_mingw"] = 0
+         self["PLATLIBDIR"] = "DLLs"
+         self["PYWINVER"] = "9.8-XY"
+         self["VPATH"] = r"..\.."
+@@ -1119,6 +1121,7 @@ class MockPosixNamespace(dict):
+         self.update(DEFAULT_NAMESPACE)
+         self["config"] = DEFAULT_CONFIG.copy()
+         self["os_name"] = "posix"
++        self["is_mingw"] = 0
+         self["PLATLIBDIR"] = "lib"
+         self["WITH_NEXT_FRAMEWORK"] = 0
+         super().__init__(*a, **kw)
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_importlib/test_windows.py Python-3.14.7-new/Lib/test/test_importlib/test_windows.py
+--- Python-3.14.7/Lib/test/test_importlib/test_windows.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_importlib/test_windows.py	2026-09-22 09:06:45.413077397 +0200
+@@ -24,6 +24,29 @@ def get_platform():
+             'x64' : 'win-amd64',
+             'arm' : 'win-arm32',
+         }
++    if os.name == 'nt':
++        if sys._is_mingw:
++            platform = "mingw"
++            if "amd64" in sys.version.lower():
++                platform += "_x86_64"
++            elif "arm64" in sys.version.lower():
++                platform += "_aarch64"
++            elif "arm" in sys.version.lower():
++                platform += "_armv7"
++            else:
++                platform += "_i686"
++
++            if "ucrt" in sys.version.lower():
++                platform += "_ucrt"
++            else:
++                platform += "_msvcrt"
++
++            if "clang" in sys.version.lower():
++                platform += "_llvm"
++            else:
++                platform += "_gnu"
++
++            return platform
+     if ('VSCMD_ARG_TGT_ARCH' in os.environ and
+         os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT):
+         return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']]
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_sysconfig.py Python-3.14.7-new/Lib/test/test_sysconfig.py
+--- Python-3.14.7/Lib/test/test_sysconfig.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_sysconfig.py	2026-09-22 09:06:45.413282083 +0200
+@@ -210,7 +210,7 @@ class TestSysConfig(unittest.TestCase, V
+         self.assertEqual(libpath, sysconfig.get_path('purelib', scheme='nt_venv', vars=vars))
+ 
+     def test_venv_scheme(self):
+-        if sys.platform == 'win32':
++        if not sys._is_mingw and sys.platform == 'win32':
+             self.assertEqual(
+                 sysconfig.get_path('scripts', scheme='venv'),
+                 sysconfig.get_path('scripts', scheme='nt_venv')
+@@ -432,6 +432,10 @@ class TestSysConfig(unittest.TestCase, V
+             if HAS_USER_BASE:
+                 user_path = get_path(name, 'posix_user')
+                 expected = os.path.normpath(global_path.replace(base, user, 1))
++                if os.name == 'nt' and sys._is_mingw:
++                    expected = expected.replace(
++                        f'python{sysconfig.get_python_version()}',
++                        f'python{sysconfig.get_python_version()}-{get_platform()}')
+                 # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
+                 # whereas posix_prefix does.
+                 if name == 'platlib':

diff --git a/0054-build-def-VPATH-when-compiling-Python-sysmodule.c.patch b/0054-build-def-VPATH-when-compiling-Python-sysmodule.c.patch
new file mode 100644
index 0000000..bf79ece
--- /dev/null
+++ b/0054-build-def-VPATH-when-compiling-Python-sysmodule.c.patch
@@ -0,0 +1,11 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:44.228641817 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:45.711799759 +0200
+@@ -2016,6 +2016,7 @@ Python/dynload_win.o: $(srcdir)/Python/d
+ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
+ 		-DABIFLAGS='"$(ABIFLAGS)"' \
++		-DVPATH='"$(VPATH)"' \
+ 		$(MULTIARCH_CPPFLAGS) \
+ 		-o $@ $(srcdir)/Python/sysmodule.c
+ 

diff --git a/0055-configure-correctly-find-native-python.patch b/0055-configure-correctly-find-native-python.patch
new file mode 100644
index 0000000..5df8918
--- /dev/null
+++ b/0055-configure-correctly-find-native-python.patch
@@ -0,0 +1,16 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:45.407720397 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:46.002678899 +0200
+@@ -204,9 +204,11 @@ AC_SUBST([FREEZE_MODULE])
+ AC_SUBST([FREEZE_MODULE_DEPS])
+ AC_SUBST([PYTHON_FOR_BUILD_DEPS])
+ 
++NATIVE_PYTHON_SEARCH_PATH_MINGW=`echo $host | grep -Eq 'mingw*' && echo "$MINGW_PREFIX/bin" || echo $PATH`
+ AC_CHECK_PROGS([PYTHON_FOR_REGEN],
+   [python$PACKAGE_VERSION python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 python3 python],
+-  [python3])
++  [python3],
++  [$NATIVE_PYTHON_SEARCH_PATH_MINGW])
+ AC_SUBST([PYTHON_FOR_REGEN])
+ 
+ AC_MSG_CHECKING([Python for regen version])

diff --git a/0056-build-Add-extra-flags-for-_bootstrap_python.patch b/0056-build-Add-extra-flags-for-_bootstrap_python.patch
new file mode 100644
index 0000000..ed48e7d
--- /dev/null
+++ b/0056-build-Add-extra-flags-for-_bootstrap_python.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:45.998747997 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:46.291658743 +0200
+@@ -1718,7 +1718,7 @@ BOOTSTRAP_HEADERS = \
+ Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS)
+ 
+ _bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local
+-	$(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(LIBRARY_OBJS_OMIT_FROZEN) \
++	$(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ -municode -mwindows $(LIBRARY_OBJS_OMIT_FROZEN) \
+ 		Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(MODLIBS) $(SYSLIBS)
+ 	# Dummy pybuilddir.txt  is needed for _bootstrap_python to be runnable
+ 	@echo "none" > ./pybuilddir.txt

diff --git a/0057-getpath-add-support-for-mingw.patch b/0057-getpath-add-support-for-mingw.patch
new file mode 100644
index 0000000..0cdb370
--- /dev/null
+++ b/0057-getpath-add-support-for-mingw.patch
@@ -0,0 +1,460 @@
+diff -rupN --no-dereference Python-3.14.7/Include/pylifecycle.h Python-3.14.7-new/Include/pylifecycle.h
+--- Python-3.14.7/Include/pylifecycle.h	2026-09-22 09:06:38.833550624 +0200
++++ Python-3.14.7-new/Include/pylifecycle.h	2026-09-22 09:06:46.577500512 +0200
+@@ -21,6 +21,7 @@ PyAPI_FUNC(int) Py_IsInitialized(void);
+ PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
+ PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
+ 
++PyAPI_FUNC(wchar_t) Py_GetAltSepW(const wchar_t *);
+ PyAPI_FUNC(wchar_t) Py_GetSepW(const wchar_t *);
+ PyAPI_FUNC(char) Py_GetSepA(const char *);
+ 
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_getpath.py Python-3.14.7-new/Lib/test/test_getpath.py
+--- Python-3.14.7/Lib/test/test_getpath.py	2026-09-22 09:06:45.706603384 +0200
++++ Python-3.14.7-new/Lib/test/test_getpath.py	2026-09-22 09:06:46.577791718 +0200
+@@ -980,6 +980,9 @@ class MockNTNamespace(dict):
+         except AttributeError:
+             raise KeyError(key) from None
+ 
++    def normpath(self, path):
++        return ntpath.normpath(path)
++
+     def abspath(self, path):
+         if self.isabs(path):
+             return path
+@@ -1158,6 +1161,9 @@ class MockPosixNamespace(dict):
+         except AttributeError:
+             raise KeyError(key) from None
+ 
++    def normpath(self, path):
++        return path
++
+     def abspath(self, path):
+         if self.isabs(path):
+             return path
+diff -rupN --no-dereference Python-3.14.7/Modules/getpath.c Python-3.14.7-new/Modules/getpath.c
+--- Python-3.14.7/Modules/getpath.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/getpath.c	2026-09-22 09:06:46.578092042 +0200
+@@ -61,6 +61,25 @@
+ /* HELPER FUNCTIONS for getpath.py */
+ 
+ static PyObject *
++getpath_normpath(PyObject *Py_UNUSED(self), PyObject *args)
++{
++    PyObject *r = NULL;
++    PyObject *pathobj;
++    wchar_t *path;
++    if (!PyArg_ParseTuple(args, "U", &pathobj)) {
++        return NULL;
++    }
++    Py_ssize_t len;
++    wchar_t *buffer = PyUnicode_AsWideCharString(pathobj, &len);
++    if (!buffer) {
++        return NULL;
++    }
++    r = PyUnicode_FromWideChar(_Py_normpath(buffer, len), -1);
++    PyMem_Free(buffer);
++    return r;
++}
++
++static PyObject *
+ getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args)
+ {
+     PyObject *r = NULL;
+@@ -94,6 +113,12 @@ getpath_basename(PyObject *Py_UNUSED(sel
+     }
+     Py_ssize_t end = PyUnicode_GET_LENGTH(path);
+     Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1);
++#ifdef ALTSEP
++    if (pos < 0) {
++        // try using altsep
++        pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1);
++    }
++#endif
+     if (pos < 0) {
+         return Py_NewRef(path);
+     }
+@@ -110,6 +135,12 @@ getpath_dirname(PyObject *Py_UNUSED(self
+     }
+     Py_ssize_t end = PyUnicode_GET_LENGTH(path);
+     Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1);
++#ifdef ALTSEP
++    if (pos < 0) {
++        // try using altsep
++        pos = PyUnicode_FindChar(path, ALTSEP, 0, end, -1);
++    }
++#endif
+     if (pos < 0) {
+         return Py_GetConstant(Py_CONSTANT_EMPTY_STR);
+     }
+@@ -564,6 +595,7 @@ done:
+ 
+ 
+ static PyMethodDef getpath_methods[] = {
++    {"normpath", getpath_normpath, METH_VARARGS, NULL},
+     {"abspath", getpath_abspath, METH_VARARGS, NULL},
+     {"basename", getpath_basename, METH_VARARGS, NULL},
+     {"dirname", getpath_dirname, METH_VARARGS, NULL},
+@@ -919,6 +951,11 @@ _PyConfig_InitPathConfig(PyConfig *confi
+ #else
+         !decode_to_dict(dict, "os_name", "posix") ||
+ #endif
++#ifdef __MINGW32__
++        !int_to_dict(dict, "is_mingw", 1) ||
++#else
++        !int_to_dict(dict, "is_mingw", 0) ||
++#endif
+ #ifdef WITH_NEXT_FRAMEWORK
+         !int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 1) ||
+ #else
+@@ -951,6 +988,9 @@ _PyConfig_InitPathConfig(PyConfig *confi
+ #ifndef MS_WINDOWS
+         PyDict_SetItemString(dict, "winreg", Py_None) < 0 ||
+ #endif
++#ifdef __MINGW32__
++        !env_to_dict(dict, "ENV_MSYSTEM", 0) ||
++#endif
+         PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins()) < 0
+     ) {
+         Py_DECREF(co);
+diff -rupN --no-dereference Python-3.14.7/Modules/getpath.py Python-3.14.7-new/Modules/getpath.py
+--- Python-3.14.7/Modules/getpath.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/getpath.py	2026-09-22 09:06:46.578380691 +0200
+@@ -30,6 +30,7 @@
+ 
+ # ** Values known at compile time **
+ # os_name           -- [in] one of 'nt', 'posix', 'darwin'
++# is_mingw          -- [in] True if targeting MinGW
+ # PREFIX            -- [in] sysconfig.get_config_var(...)
+ # EXEC_PREFIX       -- [in] sysconfig.get_config_var(...)
+ # PYTHONPATH        -- [in] sysconfig.get_config_var(...)
+@@ -52,6 +53,7 @@
+ # ENV_PYTHONHOME          -- [in] getenv(...)
+ # ENV_PYTHONEXECUTABLE    -- [in] getenv(...)
+ # ENV___PYVENV_LAUNCHER__ -- [in] getenv(...)
++# ENV_MSYSTEM             -- [in] getenv(...)
+ 
+ # ** Values calculated at runtime **
+ # config            -- [in/out] dict of the PyConfig structure
+@@ -185,8 +187,27 @@ if os_name == 'posix' or os_name == 'dar
+     ZIP_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}{VERSION_MINOR}{ABI_THREAD}.zip'
+     DELIM = ':'
+     SEP = '/'
++    ALTSEP = None
+ 
+-elif os_name == 'nt':
++elif os_name == 'nt' and is_mingw:
++    BUILDDIR_TXT = 'pybuilddir.txt'
++    BUILD_LANDMARK = 'Modules/Setup.local'
++    DEFAULT_PROGRAM_NAME = f'python{VERSION_MAJOR}'
++    STDLIB_SUBDIR = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}'
++    STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc']
++    PLATSTDLIB_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}/lib-dynload'
++    BUILDSTDLIB_LANDMARKS = ['Lib/os.py']
++    VENV_LANDMARK = 'pyvenv.cfg'
++    ZIP_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}{VERSION_MINOR}.zip'
++    DELIM = ';'
++    if ENV_MSYSTEM:
++        SEP = '/'
++        ALTSEP = '\\'
++    else:
++        SEP = '\\'
++        ALTSEP = '/'
++
++elif os_name == 'nt': # MSVC
+     BUILDDIR_TXT = 'pybuilddir.txt'
+     DEFAULT_PROGRAM_NAME = f'python'
+     STDLIB_SUBDIR = 'Lib'
+@@ -198,6 +219,7 @@ elif os_name == 'nt':
+     WINREG_KEY = f'SOFTWARE\\Python\\PythonCore\\{PYWINVER}\\PythonPath'
+     DELIM = ';'
+     SEP = '\\'
++    ALTSEP = '/'
+ 
+ 
+ # ******************************************************************************
+@@ -210,6 +232,8 @@ def search_up(prefix, *landmarks, test=i
+             return prefix
+         prefix = dirname(prefix)
+ 
++def _normpath(p):
++    return normpath(p) if p is not None else None
+ 
+ # ******************************************************************************
+ # READ VARIABLES FROM config
+@@ -261,10 +285,10 @@ if py_setpath:
+     if not executable:
+         executable = real_executable
+ 
+-if not executable and SEP in program_name:
++if not executable and (SEP in program_name or 
++                       (ALTSEP and ALTSEP in program_name)):
+     # Resolve partial path program_name against current directory
+     executable = abspath(program_name)
+-
+ if not executable:
+     # All platforms default to real_executable if known at this
+     # stage. POSIX does not set this value.
+@@ -514,8 +538,8 @@ if ((not home_was_set and real_executabl
+         pass
+ 
+     if build_prefix:
+-        if os_name == 'nt':
+-            # QUIRK: No searching for more landmarks on Windows
++        if os_name == 'nt' and not is_mingw:
++            # QUIRK: No searching for more landmarks on MSVC
+             build_stdlib_prefix = build_prefix
+         else:
+             build_stdlib_prefix = search_up(build_prefix, *BUILDSTDLIB_LANDMARKS)
+@@ -564,6 +588,9 @@ else:
+     # First try to detect prefix by looking alongside our runtime library, if known
+     if library and not prefix:
+         library_dir = dirname(library)
++        if os_name == 'nt' and is_mingw:
++            # QUIRK: On Windows, mingw Python DLLs are in the bin directory
++            library_dir = joinpath(library_dir, '..')
+         if ZIP_LANDMARK:
+             if os_name == 'nt':
+                 # QUIRK: Windows does not search up for ZIP file
+@@ -610,7 +637,7 @@ else:
+ 
+     # Detect exec_prefix by searching from executable for the platstdlib_dir
+     if PLATSTDLIB_LANDMARK and not exec_prefix:
+-        if os_name == 'nt':
++        if os_name == 'nt' and (not is_mingw):
+             # QUIRK: Windows always assumed these were the same
+             # gh-100320: Our PYDs are assumed to be relative to the Lib directory
+             # (that is, prefix) rather than the executable (that is, executable_dir)
+@@ -622,7 +649,7 @@ else:
+         if not exec_prefix and EXEC_PREFIX:
+             exec_prefix = EXEC_PREFIX
+         if not exec_prefix or not isdir(joinpath(exec_prefix, PLATSTDLIB_LANDMARK)):
+-            if os_name == 'nt':
++            if os_name == 'nt' and (not is_mingw):
+                 # QUIRK: If DLLs is missing on Windows, don't warn, just assume
+                 # that they're in exec_prefix
+                 if not platstdlib_dir:
+@@ -669,7 +696,7 @@ if not base_exec_prefix:
+ 
+ if py_setpath:
+     # If Py_SetPath was called then it overrides any existing search path
+-    config['module_search_paths'] = py_setpath.split(DELIM)
++    config['module_search_paths'] = [_normpath(p) for p in py_setpath.split(DELIM)]
+     config['module_search_paths_set'] = 1
+ 
+ elif not pythonpath_was_set:
+@@ -684,7 +711,7 @@ elif not pythonpath_was_set:
+             pythonpath.append(abspath(p))
+ 
+     # Then add the default zip file
+-    if os_name == 'nt':
++    if os_name == 'nt' and (not is_mingw):
+         # QUIRK: Windows uses the library directory rather than the prefix
+         if library:
+             library_dir = dirname(library)
+@@ -697,7 +724,7 @@ elif not pythonpath_was_set:
+     else:
+         pythonpath.append(joinpath(base_prefix, ZIP_LANDMARK))
+ 
+-    if os_name == 'nt' and use_environment and winreg:
++    if (not is_mingw) and os_name == 'nt' and use_environment and winreg:
+         # QUIRK: Windows also lists paths in the registry. Paths are stored
+         # as the default value of each subkey of
+         # {HKCU,HKLM}\Software\Python\PythonCore\{winver}\PythonPath
+@@ -738,7 +765,7 @@ elif not pythonpath_was_set:
+     if not platstdlib_dir and base_exec_prefix:
+         platstdlib_dir = joinpath(base_exec_prefix, PLATSTDLIB_LANDMARK)
+ 
+-    if os_name == 'nt':
++    if os_name == 'nt' and (not is_mingw):
+         # QUIRK: Windows generates paths differently
+         if platstdlib_dir:
+             pythonpath.append(platstdlib_dir)
+@@ -756,7 +783,7 @@ elif not pythonpath_was_set:
+         if platstdlib_dir:
+             pythonpath.append(platstdlib_dir)
+ 
+-    config['module_search_paths'] = pythonpath
++    config['module_search_paths'] = [_normpath(p) for p in pythonpath]
+     config['module_search_paths_set'] = 1
+ 
+ 
+@@ -767,11 +794,11 @@ elif not pythonpath_was_set:
+ # QUIRK: Non-Windows replaces prefix/exec_prefix with defaults when running
+ # in build directory. This happens after pythonpath calculation.
+ # Virtual environments using the build directory Python still keep their prefix.
+-if os_name != 'nt' and build_prefix:
++if (os_name != 'nt' or is_mingw) and build_prefix:
+     if not venv_prefix:
+-        prefix = config.get('prefix') or PREFIX
++        prefix = config.get('prefix') or abspath(PREFIX)
+         exec_prefix = config.get('exec_prefix') or EXEC_PREFIX or prefix
+-    base_prefix = config.get('base_prefix') or PREFIX
++    base_prefix = config.get('base_prefix') or abspath(PREFIX)
+     base_exec_prefix = config.get('base_exec_prefix') or EXEC_PREFIX or base_prefix
+ 
+ 
+@@ -795,23 +822,23 @@ if pth:
+             warn("unsupported 'import' line in ._pth file")
+         else:
+             pythonpath.append(joinpath(pth_dir, line))
+-    config['module_search_paths'] = pythonpath
++    config['module_search_paths'] = [_normpath(p) for p in pythonpath]
+     config['module_search_paths_set'] = 1
+ 
+ # ******************************************************************************
+ # UPDATE config FROM CALCULATED VALUES
+ # ******************************************************************************
+ 
+-config['program_name'] = program_name
+-config['home'] = home
+-config['executable'] = executable
+-config['base_executable'] = base_executable
+-config['prefix'] = prefix
+-config['exec_prefix'] = exec_prefix
+-config['base_prefix'] = base_prefix
+-config['base_exec_prefix'] = base_exec_prefix
++config['program_name'] = _normpath(program_name)
++config['home'] = _normpath(home)
++config['executable'] = _normpath(executable)
++config['base_executable'] = _normpath(base_executable)
++config['prefix'] = _normpath(prefix)
++config['exec_prefix'] = _normpath(exec_prefix)
++config['base_prefix'] = _normpath(base_prefix)
++config['base_exec_prefix'] = _normpath(base_exec_prefix)
+ 
+-config['platlibdir'] = platlibdir
++config['platlibdir'] = _normpath(platlibdir)
+ # test_embed expects empty strings, not None
+-config['stdlib_dir'] = stdlib_dir or ''
+-config['platstdlib_dir'] = platstdlib_dir or ''
++config['stdlib_dir'] = _normpath(stdlib_dir or '')
++config['platstdlib_dir'] = _normpath(platstdlib_dir or '')
+diff -rupN --no-dereference Python-3.14.7/Python/fileutils.c Python-3.14.7-new/Python/fileutils.c
+--- Python-3.14.7/Python/fileutils.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/fileutils.c	2026-09-22 09:06:46.578820232 +0200
+@@ -2201,7 +2201,11 @@ _Py_abspath(const wchar_t *path, wchar_t
+     }
+ 
+ #ifdef MS_WINDOWS
+-    return _PyOS_getfullpathname(path, abspath_p);
++    if (_PyOS_getfullpathname(path, abspath_p) < 0){
++        return -1;
++    }
++    *abspath_p = _Py_normpath(*abspath_p, -1);
++    return 0;
+ #else
+     wchar_t cwd[MAXPATHLEN + 1];
+     cwd[Py_ARRAY_LENGTH(cwd) - 1] = 0;
+@@ -2506,11 +2510,16 @@ _Py_normpath_and_size(wchar_t *path, Py_
+     wchar_t *minP2 = path;  // the beginning of the destination range
+     wchar_t lastC = L'\0';  // the last ljusted character, p2[-1] in most cases
+ 
++    const wchar_t sep = Py_GetSepW(NULL);
++#ifdef ALTSEP
++    const wchar_t altsep = Py_GetAltSepW(NULL);
++#endif
++
+ #define IS_END(x) (pEnd ? (x) == pEnd : !*(x))
+ #ifdef ALTSEP
+-#define IS_SEP(x) (*(x) == SEP || *(x) == ALTSEP)
++#define IS_SEP(x) (*(x) == sep || *(x) == altsep)
+ #else
+-#define IS_SEP(x) (*(x) == SEP)
++#define IS_SEP(x) (*(x) == sep)
+ #endif
+ #define SEP_OR_END(x) (IS_SEP(x) || IS_END(x))
+ 
+@@ -2523,15 +2532,15 @@ _Py_normpath_and_size(wchar_t *path, Py_
+         p2 = p1;
+ #else
+         for (; p2 < p1; ++p2) {
+-            if (*p2 == ALTSEP) {
+-                *p2 = SEP;
++            if (*p2 == altsep) {
++                *p2 = sep;
+             }
+         }
+ #endif
+         minP2 = p2 - 1;
+         lastC = *minP2;
+ #ifdef MS_WINDOWS
+-        if (lastC != SEP) {
++        if (lastC != sep) {
+             minP2++;
+         }
+ #endif
+@@ -2540,8 +2549,8 @@ _Py_normpath_and_size(wchar_t *path, Py_
+         // Skip leading '.\'
+         lastC = *++p1;
+ #ifdef ALTSEP
+-        if (lastC == ALTSEP) {
+-            lastC = SEP;
++        if (lastC == altsep) {
++            lastC = sep;
+         }
+ #endif
+         while (IS_SEP(p1)) {
+@@ -2553,18 +2562,18 @@ _Py_normpath_and_size(wchar_t *path, Py_
+     for (; !IS_END(p1); ++p1) {
+         wchar_t c = *p1;
+ #ifdef ALTSEP
+-        if (c == ALTSEP) {
+-            c = SEP;
++        if (c == altsep) {
++            c = sep;
+         }
+ #endif
+-        if (lastC == SEP) {
++        if (lastC == sep) {
+             if (c == L'.') {
+                 int sep_at_1 = SEP_OR_END(&p1[1]);
+                 int sep_at_2 = !sep_at_1 && SEP_OR_END(&p1[2]);
+                 if (sep_at_2 && p1[1] == L'.') {
+                     wchar_t *p3 = p2;
+-                    while (p3 != minP2 && *--p3 == SEP) { }
+-                    while (p3 != minP2 && *(p3 - 1) != SEP) { --p3; }
++                    while (p3 != minP2 && *--p3 == sep) { }
++                    while (p3 != minP2 && *(p3 - 1) != sep) { --p3; }
+                     if (p2 == minP2
+                         || (p3[0] == L'.' && p3[1] == L'.' && IS_SEP(&p3[2])))
+                     {
+@@ -2573,7 +2582,7 @@ _Py_normpath_and_size(wchar_t *path, Py_
+                         *p2++ = L'.';
+                         *p2++ = L'.';
+                         lastC = L'.';
+-                    } else if (p3[0] == SEP) {
++                    } else if (p3[0] == sep) {
+                         // Absolute path, so absorb segment
+                         p2 = p3 + 1;
+                     } else {
+@@ -2584,7 +2593,7 @@ _Py_normpath_and_size(wchar_t *path, Py_
+                 } else {
+                     *p2++ = lastC = c;
+                 }
+-            } else if (c == SEP) {
++            } else if (c == sep) {
+             } else {
+                 *p2++ = lastC = c;
+             }
+@@ -2594,7 +2603,7 @@ _Py_normpath_and_size(wchar_t *path, Py_
+     }
+     *p2 = L'\0';
+     if (p2 != minP2) {
+-        while (--p2 != minP2 && *p2 == SEP) {
++        while (--p2 != minP2 && *p2 == sep) {
+             *p2 = L'\0';
+         }
+     } else {
+diff -rupN --no-dereference Python-3.14.7/Python/pathconfig.c Python-3.14.7-new/Python/pathconfig.c
+--- Python-3.14.7/Python/pathconfig.c	2026-09-22 09:06:38.837392186 +0200
++++ Python-3.14.7-new/Python/pathconfig.c	2026-09-22 09:06:46.579218194 +0200
+@@ -127,7 +127,7 @@ Py_GetSepW(const wchar_t *name)
+     return sep;
+ }
+ 
+-static wchar_t
++wchar_t
+ Py_GetAltSepW(const wchar_t *name)
+ {
+     char sep = Py_GetSepW(name);

diff --git a/0058-build-Don-t-build-_posixsubprocess-on-Windows.patch b/0058-build-Don-t-build-_posixsubprocess-on-Windows.patch
new file mode 100644
index 0000000..a004eb2
--- /dev/null
+++ b/0058-build-Don-t-build-_posixsubprocess-on-Windows.patch
@@ -0,0 +1,19 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:46.287829263 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:46.872618222 +0200
+@@ -8483,7 +8483,6 @@ PY_STDLIB_MOD_SIMPLE([_heapq])
+ PY_STDLIB_MOD_SIMPLE([_json])
+ PY_STDLIB_MOD_SIMPLE([_lsprof])
+ PY_STDLIB_MOD_SIMPLE([_pickle])
+-PY_STDLIB_MOD_SIMPLE([_posixsubprocess])
+ PY_STDLIB_MOD_SIMPLE([_queue])
+ PY_STDLIB_MOD_SIMPLE([_random])
+ PY_STDLIB_MOD_SIMPLE([_remote_debugging])
+@@ -8535,6 +8534,7 @@ PY_STDLIB_MOD([_scproxy],
+   [], [-framework SystemConfiguration -framework CoreFoundation])
+ PY_STDLIB_MOD([syslog], [], [test "$ac_cv_header_syslog_h" = yes])
+ PY_STDLIB_MOD([termios], [], [test "$ac_cv_header_termios_h" = yes])
++PY_STDLIB_MOD([_posixsubprocess], [], [test "$MACHDEP" != "win32"])
+ 
+ dnl _elementtree loads libexpat via CAPI hook in pyexpat
+ PY_STDLIB_MOD([pyexpat],

diff --git a/0059-ssl-module-add-MINGW-support.patch b/0059-ssl-module-add-MINGW-support.patch
new file mode 100644
index 0000000..65527b4
--- /dev/null
+++ b/0059-ssl-module-add-MINGW-support.patch
@@ -0,0 +1,66 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:47.157598345 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:47.164967297 +0200
+@@ -8755,7 +8755,7 @@ PY_STDLIB_MOD([_zstd], [], [test "$have_
+ 
+ dnl OpenSSL bindings
+ PY_STDLIB_MOD([_ssl], [], [test "$ac_cv_working_openssl_ssl" = yes],
+-  [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS])
++  [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $OPENSSL_LIBS -lws2_32 -lcrypt32])
+ PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes],
+   [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS])
+ 
+diff -rupN --no-dereference Python-3.14.7/Modules/clinic/_ssl.c.h Python-3.14.7-new/Modules/clinic/_ssl.c.h
+--- Python-3.14.7/Modules/clinic/_ssl.c.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/clinic/_ssl.c.h	2026-09-22 09:06:47.164287291 +0200
+@@ -2736,7 +2736,7 @@ exit:
+     return return_value;
+ }
+ 
+-#if defined(_MSC_VER)
++#if defined(_WIN32)
+ 
+ PyDoc_STRVAR(_ssl_enum_certificates__doc__,
+ "enum_certificates($module, /, store_name)\n"
+@@ -2816,9 +2816,9 @@ exit:
+     return return_value;
+ }
+ 
+-#endif /* defined(_MSC_VER) */
++#endif /* defined(_WIN32) */
+ 
+-#if defined(_MSC_VER)
++#if defined(_WIN32)
+ 
+ PyDoc_STRVAR(_ssl_enum_crls__doc__,
+ "enum_crls($module, /, store_name)\n"
+@@ -2897,7 +2897,7 @@ exit:
+     return return_value;
+ }
+ 
+-#endif /* defined(_MSC_VER) */
++#endif /* defined(_WIN32) */
+ 
+ #ifndef _SSL_ENUM_CERTIFICATES_METHODDEF
+     #define _SSL_ENUM_CERTIFICATES_METHODDEF
+diff -rupN --no-dereference Python-3.14.7/Modules/_ssl.c Python-3.14.7-new/Modules/_ssl.c
+--- Python-3.14.7/Modules/_ssl.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_ssl.c	2026-09-22 09:06:47.162597996 +0200
+@@ -5972,7 +5972,7 @@ _ssl_nid2obj_impl(PyObject *module, int
+     return result;
+ }
+ 
+-#ifdef _MSC_VER
++#ifdef _WIN32
+ 
+ static PyObject*
+ certEncodingType(DWORD encodingType)
+@@ -6291,7 +6291,7 @@ _ssl_enum_crls_impl(PyObject *module, co
+     }
+ }
+ 
+-#endif /* _MSC_VER */
++#endif /* _WIN32 */
+ 
+ /* List of functions exported by this module. */
+ static PyMethodDef PySSL_methods[] = {

diff --git a/0060-configure-Include-winsock.h-when-checking-for-netdb-.patch b/0060-configure-Include-winsock.h-when-checking-for-netdb-.patch
new file mode 100644
index 0000000..b9960ef
--- /dev/null
+++ b/0060-configure-Include-winsock.h-when-checking-for-netdb-.patch
@@ -0,0 +1,45 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:47.456577491 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:47.462577073 +0200
+@@ -5581,7 +5581,7 @@ AC_CHECK_FUNCS([ \
+   faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
+   fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
+   gai_strerror getegid geteuid getgid getgrent getgrgid getgrgid_r \
+-  getgrnam_r getgrouplist gethostname getitimer getloadavg getlogin getlogin_r \
++  getgrnam_r getgrouplist getitimer getloadavg getlogin getlogin_r \
+   getpeername getpgid getpid getppid getpriority _getpty \
+   getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \
+   getspnam getuid getwd grantpt if_nameindex initgroups kill killpg lchown linkat \
+@@ -5598,7 +5598,7 @@ AC_CHECK_FUNCS([ \
+   sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
+   sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
+   setitimer setlocale setpgid setpgrp setpriority setregid setresgid \
+-  setresuid setreuid setsid setuid setvbuf shutdown sigaction sigaltstack \
++  setresuid setreuid setsid setuid setvbuf sigaction sigaltstack \
+   sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
+   sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
+   sysconf sysctlbyname tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
+@@ -5865,7 +5865,13 @@ PKG_CHECK_MODULES([LIBZSTD], [libzstd >=
+ ])
+ 
+ dnl PY_CHECK_NETDB_FUNC(FUNCTION)
+-AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [@%:@include <netdb.h>])])
++AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [
++#ifdef _WIN32
++  #include <winsock.h>
++#else
++  #include <netdb.h>
++#endif
++])])
+ 
+ PY_CHECK_NETDB_FUNC([hstrerror])
+ dnl not available in WASI yet
+@@ -5874,6 +5880,8 @@ PY_CHECK_NETDB_FUNC([getservbyport])
+ PY_CHECK_NETDB_FUNC([gethostbyname])
+ PY_CHECK_NETDB_FUNC([gethostbyaddr])
+ PY_CHECK_NETDB_FUNC([getprotobyname])
++PY_CHECK_NETDB_FUNC([gethostname])
++PY_CHECK_NETDB_FUNC([shutdown])
+ 
+ dnl PY_CHECK_SOCKET_FUNC(FUNCTION)
+ AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [

diff --git a/0061-configure-always-build-_multiprocessing-on-Windows.patch b/0061-configure-always-build-_multiprocessing-on-Windows.patch
new file mode 100644
index 0000000..7d4c195
--- /dev/null
+++ b/0061-configure-always-build-_multiprocessing-on-Windows.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:47.748557126 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:47.754169236 +0200
+@@ -8505,7 +8505,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo])
+ 
+ dnl multiprocessing modules
+ PY_STDLIB_MOD([_multiprocessing],
+-  [], [test "$ac_cv_func_sem_unlink" = "yes"],
++  [], [test "$ac_cv_func_sem_unlink" = "yes" -o "$MACHDEP" = "win32"],
+   [-I\$(srcdir)/Modules/_multiprocessing])
+ PY_STDLIB_MOD([_posixshmem],
+   [], [test "$have_posix_shmem" = "yes"],

diff --git a/0062-configure-build-mmap-module-on-win32.patch b/0062-configure-build-mmap-module-on-win32.patch
new file mode 100644
index 0000000..d7e8682
--- /dev/null
+++ b/0062-configure-build-mmap-module-on-win32.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:48.044142988 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:48.048935955 +0200
+@@ -8524,7 +8524,9 @@ PY_STDLIB_MOD([fcntl],
+   [], [test "$ac_cv_header_sys_ioctl_h" = "yes" -a "$ac_cv_header_fcntl_h" = "yes"],
+   [], [$FCNTL_LIBS])
+ PY_STDLIB_MOD([mmap],
+-  [], [test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"])
++  [], m4_flatten([test "$ac_cv_header_sys_mman_h" = "yes"
++                    -a "$ac_cv_header_sys_stat_h" = "yes"
++                    -o "$MACHDEP" = "win32"]))
+ PY_STDLIB_MOD([_socket],
+   [], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes"
+                     -a "$ac_cv_header_sys_types_h" = "yes"

diff --git a/0063-configure-set-BUILDEXEEXT-and-EXEEXT.patch b/0063-configure-set-BUILDEXEEXT-and-EXEEXT.patch
new file mode 100644
index 0000000..bd8ac80
--- /dev/null
+++ b/0063-configure-set-BUILDEXEEXT-and-EXEEXT.patch
@@ -0,0 +1,22 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:48.349515208 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:48.355034575 +0200
+@@ -1444,6 +1444,7 @@ AC_ARG_WITH([suffix],
+   AS_CASE([$ac_sys_system],
+     [Emscripten], [EXEEXT=.mjs],
+     [WASI], [EXEEXT=.wasm],
++    [MINGW*], [EXEEXT=.exe],
+     [EXEEXT=]
+   )
+ ])
+@@ -1470,6 +1471,10 @@ else
+ fi
+ rmdir CaseSensitiveTestDir
+ 
++AS_CASE([$ac_sys_system],
++  [MINGW], [BUILDEXEEXT=".exe"]
++)
++
+ case $ac_sys_system in
+ hp*|HP*)
+     case $ac_cv_cc_name in

diff --git a/0064-configure-fix-building-some-test-modules.patch b/0064-configure-fix-building-some-test-modules.patch
new file mode 100644
index 0000000..5810de7
--- /dev/null
+++ b/0064-configure-fix-building-some-test-modules.patch
@@ -0,0 +1,44 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:48.641494843 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:48.646950910 +0200
+@@ -5506,8 +5506,11 @@ fi
+ AC_MSG_RESULT([$DYNLOADFILE])
+ if test "$DYNLOADFILE" != "dynload_stub.o"
+ then
++  have_dynamic_loading=yes
+ 	AC_DEFINE([HAVE_DYNAMIC_LOADING], [1],
+         [Defined when any dynamic module loading is enabled.])
++else
++  have_dynamic_loading=no
+ fi
+ 
+ # MS_DLL_ID is used for sys.winver and Windows registry keys.
+@@ -8793,22 +8796,22 @@ PY_STDLIB_MOD([_testclinic_limited], [te
+ PY_STDLIB_MOD([_testlimitedcapi], [test "$TEST_MODULES" = yes])
+ PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes])
+ PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes])
+-PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
+-PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
+-PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
++PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes])
++PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes])
++PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$have_dynamic_loading" = yes])
+ PY_STDLIB_MOD([xxsubtype], [test "$TEST_MODULES" = yes])
+ PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes])
+ PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"])
+ dnl Check have_libffi so _ctypes_test is only built if _ctypes is built.
+ dnl _ctypes_test doesn't use libffi directly.
+ PY_STDLIB_MOD([_ctypes_test],
+-  [test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$ac_cv_func_dlopen" = yes],
++  [test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$have_dynamic_loading" = yes],
+   [], [$LIBM])
+ 
+ dnl Limited API template modules.
+ dnl Emscripten does not support shared libraries yet.
+-PY_STDLIB_MOD([xxlimited], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
+-PY_STDLIB_MOD([xxlimited_35], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
++PY_STDLIB_MOD([xxlimited], [test "$TEST_MODULES" = "yes"], [test "$have_dynamic_loading" = yes])
++PY_STDLIB_MOD([xxlimited_35], [test "$TEST_MODULES" = "yes"], [test "$have_dynamic_loading" = yes])
+ 
+ # substitute multiline block, must come after last PY_STDLIB_MOD()
+ AC_SUBST([MODULE_BLOCK])

diff --git a/0065-Always-convert-to-before-passing-though-pathcch-func.patch b/0065-Always-convert-to-before-passing-though-pathcch-func.patch
new file mode 100644
index 0000000..1ac78b6
--- /dev/null
+++ b/0065-Always-convert-to-before-passing-though-pathcch-func.patch
@@ -0,0 +1,86 @@
+diff -rupN --no-dereference Python-3.14.7/Include/pylifecycle.h Python-3.14.7-new/Include/pylifecycle.h
+--- Python-3.14.7/Include/pylifecycle.h	2026-09-22 09:06:46.867171629 +0200
++++ Python-3.14.7-new/Include/pylifecycle.h	2026-09-22 09:06:48.949577014 +0200
+@@ -28,6 +28,8 @@ PyAPI_FUNC(char) Py_GetSepA(const char *
+ PyAPI_FUNC(void) Py_NormalizeSepsW(wchar_t *);
+ PyAPI_FUNC(void) Py_NormalizeSepsA(char *);
+ 
++PyAPI_FUNC(void) Py_NormalizeSepsPathcchW(wchar_t *);
++
+ 
+ /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
+  * exit functions.
+diff -rupN --no-dereference Python-3.14.7/Python/fileutils.c Python-3.14.7-new/Python/fileutils.c
+--- Python-3.14.7/Python/fileutils.c	2026-09-22 09:06:46.868959065 +0200
++++ Python-3.14.7-new/Python/fileutils.c	2026-09-22 09:06:48.949919163 +0200
+@@ -2156,19 +2156,31 @@ int
+ _Py_isabs(const wchar_t *path)
+ {
+ #ifdef MS_WINDOWS
++    // create a copy of path and replace all forward slashes with backslashes
++    // pathccskiproot does not handle forward slashes
++    wchar_t *path_copy = _wcsdup(path);
++    if (path_copy == NULL) {
++        return 0;
++    }
++    Py_NormalizeSepsPathcchW(path_copy);
++
+     const wchar_t *tail;
+-    HRESULT hr = PathCchSkipRoot(path, &tail);
+-    if (FAILED(hr) || path == tail) {
++    HRESULT hr = PathCchSkipRoot(path_copy, &tail);
++    if (FAILED(hr) || path_copy == tail) {
++        free(path_copy);
+         return 0;
+     }
+-    if (tail == &path[1] && (path[0] == SEP || path[0] == ALTSEP)) {
++    if (tail == &path_copy[1] && (path_copy[0] == SEP || path_copy[0] == ALTSEP)) {
+         // Exclude paths with leading SEP
++        free(path_copy);
+         return 0;
+     }
+-    if (tail == &path[2] && path[1] == L':') {
++    if (tail == &path_copy[2] && path_copy[1] == L':') {
+         // Exclude drive-relative paths (e.g. C:filename.ext)
++        free(path_copy);
+         return 0;
+     }
++    free(path_copy);
+     return 1;
+ #else
+     return (path[0] == SEP);
+@@ -2408,6 +2420,8 @@ join_relfile(wchar_t *buffer, size_t buf
+              const wchar_t *dirname, const wchar_t *relfile)
+ {
+ #ifdef MS_WINDOWS
++    Py_NormalizeSepsPathcchW(dirname);
++    Py_NormalizeSepsPathcchW(relfile);
+     if (FAILED(PathCchCombineEx(buffer, bufsize, dirname, relfile,
+         PATHCCH_ALLOW_LONG_PATHS))) {
+         return -1;
+diff -rupN --no-dereference Python-3.14.7/Python/pathconfig.c Python-3.14.7-new/Python/pathconfig.c
+--- Python-3.14.7/Python/pathconfig.c	2026-09-22 09:06:46.869469972 +0200
++++ Python-3.14.7-new/Python/pathconfig.c	2026-09-22 09:06:48.950260276 +0200
+@@ -153,6 +153,22 @@ Py_NormalizeSepsW(wchar_t *name)
+     }
+ }
+ 
++void
++Py_NormalizeSepsPathcchW(wchar_t *name)
++{
++#ifdef MS_WINDOWS
++    assert(name != NULL);
++    wchar_t sep = '\\';
++    wchar_t altsep = '/';
++    wchar_t* seps;
++    seps = wcschr(name, altsep);
++    while(seps) {
++        *seps = sep;
++        seps = wcschr(seps, altsep);
++    }
++#endif
++}
++
+ /* External interface */
+ 
+ /* Stored values set by C API functions */

diff --git a/0066-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch b/0066-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch
new file mode 100644
index 0000000..55c1e7b
--- /dev/null
+++ b/0066-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch
@@ -0,0 +1,13 @@
+diff -rupN --no-dereference Python-3.14.7/Include/pylifecycle.h Python-3.14.7-new/Include/pylifecycle.h
+--- Python-3.14.7/Include/pylifecycle.h	2026-09-22 09:06:49.233057562 +0200
++++ Python-3.14.7-new/Include/pylifecycle.h	2026-09-22 09:06:49.237693792 +0200
+@@ -53,9 +53,6 @@ Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *
+ Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
+ Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
+ Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPath(void);
+-#ifdef MS_WINDOWS
+-int _Py_CheckPython3(void);
+-#endif
+ 
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);

diff --git a/0067-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch b/0067-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch
new file mode 100644
index 0000000..b61c51b
--- /dev/null
+++ b/0067-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch
@@ -0,0 +1,82 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/__main__.py Python-3.14.7-new/Lib/test/__main__.py
+--- Python-3.14.7/Lib/test/__main__.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/__main__.py	2026-09-22 09:06:49.524749398 +0200
+@@ -1,2 +1,10 @@
++import os
++import sys
++
+ from test.libregrtest.main import main
++
++if sys.platform == "win32":
++    # Enable DLL loading from PATH.
++    os.environ["PYTHONLEGACYWINDOWSDLLLOADING"] = "1"
++
+ main(_add_python_opts=True)
+diff -rupN --no-dereference Python-3.14.7/mingw_smoketests.py Python-3.14.7-new/mingw_smoketests.py
+--- Python-3.14.7/mingw_smoketests.py	2026-09-22 09:06:45.119798061 +0200
++++ Python-3.14.7-new/mingw_smoketests.py	2026-09-22 09:06:49.525466855 +0200
+@@ -35,6 +35,9 @@ if sys._use_alt_sep:
+ else:
+     SEP = "\\"
+ 
++if sysconfig.is_python_build():
++    os.environ["PYTHONLEGACYWINDOWSDLLLOADING"] = "1"
++
+ _UCRT = 'ucrt' in sysconfig.get_platform()
+ 
+ 
+diff -rupN --no-dereference Python-3.14.7/Python/dynload_win.c Python-3.14.7-new/Python/dynload_win.c
+--- Python-3.14.7/Python/dynload_win.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/dynload_win.c	2026-09-22 09:06:49.524996894 +0200
+@@ -6,6 +6,7 @@
+ #include "pycore_importdl.h"      // dl_funcptr
+ #include "pycore_interp.h"        // _PyInterpreterState_GetConfig()
+ #include "pycore_pystate.h"       // _PyInterpreterState_GET()
++#include "pycore_initconfig.h"
+ 
+ #include "patchlevel.h"           // PY_MAJOR_VERSION
+ #include <windows.h>
+@@ -212,6 +213,18 @@ dl_funcptr _PyImport_FindSharedFuncptrWi
+     _Py_CheckPython3();
+ #endif /* Py_ENABLE_SHARED */
+ 
++    int use_legacy = 0;
++    DWORD load_library_flags = 0;
++
++    _Py_get_env_flag(1, &use_legacy, "PYTHONLEGACYWINDOWSDLLLOADING");
++
++    if (use_legacy) {
++        load_library_flags = LOAD_WITH_ALTERED_SEARCH_PATH;
++    } else {
++        load_library_flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
++                              LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR;
++    }
++
+     wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL);
+     if (wpathname == NULL)
+         return NULL;
+@@ -232,9 +245,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWi
+            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_library_flags);
+         Py_END_ALLOW_THREADS
+         PyMem_Free(wpathname);
+ 
+diff -rupN --no-dereference Python-3.14.7/Tools/build/check_extension_modules.py Python-3.14.7-new/Tools/build/check_extension_modules.py
+--- Python-3.14.7/Tools/build/check_extension_modules.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Tools/build/check_extension_modules.py	2026-09-22 09:06:49.525203980 +0200
+@@ -69,6 +69,10 @@ WINDOWS_MODULES = {
+     "winsound",
+ }
+ 
++if sys.platform == "win32":
++    # Enable DLL loading from PATH.
++    os.environ["PYTHONLEGACYWINDOWSDLLLOADING"] = "1"
++
+ 
+ logger = logging.getLogger(__name__)
+ 

diff --git a/0068-dynload_win-Port-GetPythonImport-to-MINGW.patch b/0068-dynload_win-Port-GetPythonImport-to-MINGW.patch
new file mode 100644
index 0000000..1ec8844
--- /dev/null
+++ b/0068-dynload_win-Port-GetPythonImport-to-MINGW.patch
@@ -0,0 +1,61 @@
+diff -rupN --no-dereference Python-3.14.7/Python/dynload_win.c Python-3.14.7-new/Python/dynload_win.c
+--- Python-3.14.7/Python/dynload_win.c	2026-09-22 09:06:49.814060358 +0200
++++ Python-3.14.7-new/Python/dynload_win.c	2026-09-22 09:06:49.818052588 +0200
+@@ -38,6 +38,16 @@ const char *_PyImport_DynLoadFiletab[] =
+ #define DWORD_AT(mem) (*(DWORD *)(mem))
+ #define WORD_AT(mem)  (*(WORD *)(mem))
+ 
++#ifdef __MINGW32__
++#define DLL_PREFIX "libpython"
++#define DLL_PREFIX_LEN 9
++#define DLL_NAME_FORMAT "libpython%d.%d"
++#else
++#define DLL_PREFIX "python"
++#define DLL_PREFIX_LEN 6
++#define DLL_NAME_FORMAT "python%d%d"
++#endif
++
+ static char *GetPythonImport (HINSTANCE hModule)
+ {
+     unsigned char *dllbase, *import_data, *import_name;
+@@ -104,15 +114,15 @@ static char *GetPythonImport (HINSTANCE
+                                          import_off);
+         while (DWORD_AT(import_data)) {
+             import_name = dllbase + DWORD_AT(import_data+12);
+-            if (strlen(import_name) >= 6 &&
+-                !strncmp(import_name,"python",6)) {
++            if (strlen(import_name) >= DLL_PREFIX_LEN &&
++                !strncmp(import_name, DLL_PREFIX, DLL_PREFIX_LEN)) {
+                 char *pch;
+ 
+                 /* Don't claim that python3.dll is a Python DLL. */
+ #ifdef _DEBUG
+-                if (strcmp(import_name, "python3_d.dll") == 0) {
++                if (strcmp(import_name, DLL_PREFIX "3_d.dll") == 0) {
+ #else
+-                if (strcmp(import_name, "python3.dll") == 0) {
++                if (strcmp(import_name, DLL_PREFIX "3.dll") == 0) {
+ #endif
+                     import_data += 20;
+                     continue;
+@@ -120,7 +130,7 @@ static char *GetPythonImport (HINSTANCE
+ 
+                 /* Ensure python prefix is followed only
+                    by numbers to the end of the basename */
+-                pch = import_name + 6;
++                pch = import_name + DLL_PREFIX_LEN;
+ #ifdef _DEBUG
+                 while (*pch && pch[0] != '_' && pch[1] != 'd' && pch[2] != '.') {
+ #else
+@@ -312,9 +322,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWi
+ 
+             PyOS_snprintf(buffer, sizeof(buffer),
+ #ifdef _DEBUG
+-                          "python%d%d_d.dll",
++                          DLL_NAME_FORMAT "_d.dll",
+ #else
+-                          "python%d%d.dll",
++                          DLL_NAME_FORMAT ".dll",
+ #endif
+                           PY_MAJOR_VERSION,PY_MINOR_VERSION);
+             import_python = GetPythonImport(hDLL);

diff --git a/0069-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch b/0069-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch
new file mode 100644
index 0000000..7268cb3
--- /dev/null
+++ b/0069-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch
@@ -0,0 +1,19 @@
+diff -rupN --no-dereference Python-3.14.7/Python/dynload_win.c Python-3.14.7-new/Python/dynload_win.c
+--- Python-3.14.7/Python/dynload_win.c	2026-09-22 09:06:50.105961311 +0200
++++ Python-3.14.7-new/Python/dynload_win.c	2026-09-22 09:06:50.110211529 +0200
+@@ -239,6 +239,15 @@ dl_funcptr _PyImport_FindSharedFuncptrWi
+     if (wpathname == NULL)
+         return NULL;
+ 
++    // LoadLibraryExW only considers paths using backslashes as "fully qualified",
++    // and for example LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR doesn't work with forward slashes.
++    // https://github.com/msys2-contrib/cpython-mingw/issues/151
++    for (size_t i = 0; wpathname[i] != L'\0'; ++i) {
++        if (wpathname[i] == L'/') {
++            wpathname[i] = L'\\';
++        }
++    }
++
+     PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
+ 
+     {

diff --git a/0070-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch b/0070-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch
new file mode 100644
index 0000000..3cc123c
--- /dev/null
+++ b/0070-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch
@@ -0,0 +1,15 @@
+diff -rupN --no-dereference Python-3.14.7/Python/dynload_win.c Python-3.14.7-new/Python/dynload_win.c
+--- Python-3.14.7/Python/dynload_win.c	2026-09-22 09:06:50.394788015 +0200
++++ Python-3.14.7-new/Python/dynload_win.c	2026-09-22 09:06:50.398326421 +0200
+@@ -219,9 +219,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWi
+     dl_funcptr p;
+     char funcname[258], *import_python;
+ 
+-#ifdef Py_ENABLE_SHARED
++#if defined(Py_ENABLE_SHARED) && defined(_MSC_VER)
+     _Py_CheckPython3();
+-#endif /* Py_ENABLE_SHARED */
++#endif /* defined(Py_ENABLE_SHARED) && defined(_MSC_VER) */
+ 
+     int use_legacy = 0;
+     DWORD load_library_flags = 0;

diff --git a/0071-build-Build-and-install-libpython3.dll-stable-ABI.patch b/0071-build-Build-and-install-libpython3.dll-stable-ABI.patch
new file mode 100644
index 0000000..286c4ff
--- /dev/null
+++ b/0071-build-Build-and-install-libpython3.dll-stable-ABI.patch
@@ -0,0 +1,92 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:46.572639145 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:50.689176181 +0200
+@@ -299,6 +299,8 @@ LIBRARY_DEPS=	@LIBRARY_DEPS@
+ LINK_PYTHON_DEPS=@LINK_PYTHON_DEPS@
+ PY_ENABLE_SHARED=	@PY_ENABLE_SHARED@
+ STATIC_LIBPYTHON=	@STATIC_LIBPYTHON@
++ABI3DLLLIBRARY= libpython3$(ABIFLAGS).dll
++ABI3LDLIBRARY=  libpython3$(ABIFLAGS).dll.a
+ 
+ 
+ LIBS=		@LIBS@
+@@ -816,7 +818,7 @@ list-targets:
+ 
+ .PHONY: build_all
+ build_all:	check-clean-src check-app-store-compliance $(BUILDPYTHON) $(BUILDPYTHONW) $(BUILDVENVLAUNCHER) $(BUILDVENVWLAUNCHER) platform sharedmods \
+-		gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json
++		gdbhooks Programs/_testembed scripts checksharedmods rundsymutil build-details.json $(ABI3DLLLIBRARY) $(ABI3LDLIBRARY)
+ 
+ .PHONY: build_wasm
+ build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \
+@@ -1008,6 +1010,9 @@ pythonw_exe.o: $(srcdir)/PC/pythonw_exe.
+ python_nt.o: $(srcdir)/PC/python_nt.rc
+ 	$(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@
+ 
++python3dll_nt.o: $(srcdir)/PC/python_nt.rc
++	$(WINDRES) $(RCFLAGS) -DORIGINAL_FILENAME=\\\"$(ABI3DLLLIBRARY)\\\" -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@
++
+ venvlauncher.o: $(srcdir)/PC/pylauncher.rc
+ 	$(WINDRES) $(RCFLAGS) -DPY_ICON -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pylauncher.rc $@
+ 
+@@ -1136,6 +1141,10 @@ $(DLLLIBRARY) libpython$(LDVERSION).dll.
+ 	else true; \
+ 	fi
+ 
++$(ABI3DLLLIBRARY) $(ABI3LDLIBRARY): python3dll_nt.o $(srcdir)/PC/launcher.c
++	$(LDSHARED) -DPYTHON_DLL_NAME=\"$(DLLLIBRARY)\" $(srcdir)/PC/python3dll.c -Wl,--out-implib=$(ABI3LDLIBRARY) -o $(ABI3DLLLIBRARY) python3dll_nt.o \
++		$(LDFLAGS_NODIST);
++
+ # wasm32-emscripten browser web example
+ 
+ EMSCRIPTEN_DIR=$(srcdir)/Platforms/emscripten
+@@ -2496,6 +2505,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
+ 		if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+ 			if test -n "$(DLLLIBRARY)" ; then \
+ 				$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
++				$(INSTALL_SHARED) $(ABI3DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+ 			else \
+ 				$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
+ 				if test $(LDLIBRARY) != $(INSTSONAME); then \
+@@ -2994,6 +3004,7 @@ libainstall: all scripts
+ 			if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+ 				if test "$(SHLIB_SUFFIX)" = .dll -o "$(SHLIB_SUFFIX)" = .pyd; then \
+ 					$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
++					$(INSTALL_DATA) $(ABI3LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
+ 				else \
+ 					$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+ 				fi; \
+@@ -3320,7 +3331,7 @@ clean: clean-profile clean-jit-stencils
+ 
+ .PHONY: clobber
+ clobber: clean
+-	-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
++	-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) $(ABI3LDLIBRARY) $(ABI3DLLLIBRARY) \
+ 		tags TAGS \
+ 		config.cache config.log pyconfig.h Modules/config.c
+ 	-rm -rf build platform
+diff -rupN --no-dereference Python-3.14.7/PC/python3dll.c Python-3.14.7-new/PC/python3dll.c
+--- Python-3.14.7/PC/python3dll.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/python3dll.c	2026-09-22 09:06:50.689713155 +0200
+@@ -2,6 +2,7 @@
+ 
+ /* Generated by Tools/build/stable_abi.py */
+ 
++#ifdef _MSC_VER
+ #ifdef _M_IX86
+ #define DECORATE "_"
+ #else
+@@ -12,6 +13,13 @@
+     __pragma(comment(linker, "/EXPORT:" DECORATE #name "=" PYTHON_DLL_NAME "." #name))
+ #define EXPORT_DATA(name) \
+     __pragma(comment(linker, "/EXPORT:" DECORATE #name "=" PYTHON_DLL_NAME "." #name ",DATA"))
++#else
++// XXX: Why do we need the .dll extension and no DECORATE compared to the MSVC case?
++#define EXPORT_FUNC(name) \
++    asm(".section .drectve\n\t.ascii \" -export:" #name "=\\\"" PYTHON_DLL_NAME "." #name "\\\" \"");
++#define EXPORT_DATA(name) \
++    asm(".section .drectve\n\t.ascii \" -export:" #name "=\\\"" PYTHON_DLL_NAME "." #name "\\\",DATA \"");
++#endif
+ 
+ EXPORT_FUNC(_Py_BuildValue_SizeT)
+ EXPORT_FUNC(_Py_CheckRecursiveCall)

diff --git a/0072-configure-define-_DEBUG-for-a-debug-build.patch b/0072-configure-define-_DEBUG-for-a-debug-build.patch
new file mode 100644
index 0000000..3ef3d1b
--- /dev/null
+++ b/0072-configure-define-_DEBUG-for-a-debug-build.patch
@@ -0,0 +1,44 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:48.945158135 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:50.985295085 +0200
+@@ -2414,6 +2414,7 @@ _RESTORE_VAR([CFLAGS])
+ PYDEBUG_CFLAGS="-O0"
+ AS_VAR_IF([ac_cv_cc_supports_og], [yes],
+           [PYDEBUG_CFLAGS="-Og"])
++PYDEBUG_CFLAGS="-D_DEBUG $PYDEBUG_CFLAGS"
+ 
+ # gh-120688: WASI uses -O3 in debug mode to support more recursive calls
+ if test "$ac_sys_system" = "WASI"; then
+diff -rupN --no-dereference Python-3.14.7/Modules/_winapi.c Python-3.14.7-new/Modules/_winapi.c
+--- Python-3.14.7/Modules/_winapi.c	2026-09-22 09:06:35.335296656 +0200
++++ Python-3.14.7-new/Modules/_winapi.c	2026-09-22 09:06:50.983331494 +0200
+@@ -1497,7 +1497,7 @@ static PyObject *
+ _winapi_ExitProcess_impl(PyObject *module, UINT ExitCode)
+ /*[clinic end generated code: output=a387deb651175301 input=4f05466a9406c558]*/
+ {
+-    #if defined(Py_DEBUG)
++    #if defined(Py_DEBUG) && defined(_MSC_VER)
+ #ifdef MS_WINDOWS_DESKTOP
+         SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|
+                      SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX);
+diff -rupN --no-dereference Python-3.14.7/PC/clinic/msvcrtmodule.c.h Python-3.14.7-new/PC/clinic/msvcrtmodule.c.h
+--- Python-3.14.7/PC/clinic/msvcrtmodule.c.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/clinic/msvcrtmodule.c.h	2026-09-22 09:06:50.984713737 +0200
+@@ -517,7 +517,7 @@ exit:
+ 
+ #endif /* defined(MS_WINDOWS_DESKTOP) */
+ 
+-#if defined(_DEBUG)
++#if defined(_DEBUG) && defined(_MSC_VER)
+ 
+ PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__,
+ "CrtSetReportFile($module, type, file, /)\n"
+@@ -564,7 +564,7 @@ exit:
+ 
+ #endif /* defined(_DEBUG) */
+ 
+-#if defined(_DEBUG)
++#if defined(_DEBUG) && defined(_MSC_VER)
+ 
+ PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__,
+ "CrtSetReportMode($module, type, mode, /)\n"

diff --git a/0073-configure-fix-multiprocessing-module.patch b/0073-configure-fix-multiprocessing-module.patch
new file mode 100644
index 0000000..5cc97fe
--- /dev/null
+++ b/0073-configure-fix-multiprocessing-module.patch
@@ -0,0 +1,26 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:51.269004668 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:51.274311197 +0200
+@@ -4617,6 +4617,13 @@ AS_CASE([$MACHDEP],
+   [SOCKET_LIBS=""]
+ )
+ 
++dnl On MINGW, you need to link againt ws2_32 for _multiprocessing
++AS_CASE([$MACHDEP],
++  [win32], [MULTIPROCESSING_LIBS="-lws2_32"],
++  [MULTIPROCESSING_LIBS=""]
++)
++
++
+ dnl detect sqlite3 from Emscripten emport
+ PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
+ 
+@@ -8515,7 +8522,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo])
+ dnl multiprocessing modules
+ PY_STDLIB_MOD([_multiprocessing],
+   [], [test "$ac_cv_func_sem_unlink" = "yes" -o "$MACHDEP" = "win32"],
+-  [-I\$(srcdir)/Modules/_multiprocessing])
++  [-I\$(srcdir)/Modules/_multiprocessing], [$MULTIPROCESSING_LIBS])
+ PY_STDLIB_MOD([_posixshmem],
+   [], [test "$have_posix_shmem" = "yes"],
+   [$POSIXSHMEM_CFLAGS], [$POSIXSHMEM_LIBS])

diff --git a/0074-build-add-MINGW-support-for-selectmodule.patch b/0074-build-add-MINGW-support-for-selectmodule.patch
new file mode 100644
index 0000000..abdd9d6
--- /dev/null
+++ b/0074-build-add-MINGW-support-for-selectmodule.patch
@@ -0,0 +1,48 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:51.564290970 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:51.571040793 +0200
+@@ -4623,6 +4623,11 @@ AS_CASE([$MACHDEP],
+   [MULTIPROCESSING_LIBS=""]
+ )
+ 
++dnl On MINGW, you need to link againt ws2_32 for selectmodule
++AS_CASE([$MACHDEP],
++  [win32], [SELECTMODULE_LIBS="-lws2_32"],
++  [SELECTMODULE_LIBS=""]
++)
+ 
+ dnl detect sqlite3 from Emscripten emport
+ PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
+@@ -8510,7 +8515,7 @@ PY_STDLIB_MOD_SIMPLE([_pickle])
+ PY_STDLIB_MOD_SIMPLE([_queue])
+ PY_STDLIB_MOD_SIMPLE([_random])
+ PY_STDLIB_MOD_SIMPLE([_remote_debugging])
+-PY_STDLIB_MOD_SIMPLE([select])
++PY_STDLIB_MOD_SIMPLE([select], [], [$SELECTMODULE_LIBS])
+ PY_STDLIB_MOD_SIMPLE([_struct])
+ PY_STDLIB_MOD_SIMPLE([_types])
+ PY_STDLIB_MOD_SIMPLE([_typing])
+diff -rupN --no-dereference Python-3.14.7/Modules/selectmodule.c Python-3.14.7-new/Modules/selectmodule.c
+--- Python-3.14.7/Modules/selectmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/selectmodule.c	2026-09-22 09:06:51.569290622 +0200
+@@ -167,9 +167,9 @@ seq2set(PyObject *seq, fd_set *set, pyli
+         v = PyObject_AsFileDescriptor( o );
+         if (v == -1) goto finally;
+ 
+-#if defined(_MSC_VER)
++#if defined(MS_WIN32)
+         max = 0;                             /* not used for Win32 */
+-#else  /* !_MSC_VER */
++#else  /* !MS_WIN32 */
+         if (!_PyIsSelectable_fd(v)) {
+             PyErr_SetString(PyExc_ValueError,
+                         "filedescriptor out of range in select()");
+@@ -177,7 +177,7 @@ seq2set(PyObject *seq, fd_set *set, pyli
+         }
+         if (v > max)
+             max = v;
+-#endif /* _MSC_VER */
++#endif /* MS_WIN32 */
+         FD_SET(v, set);
+ 
+         /* add object and its file descriptor to the list */

diff --git a/0075-configure-disable-various-modules-on-MINGW.patch b/0075-configure-disable-various-modules-on-MINGW.patch
new file mode 100644
index 0000000..ce0c1bc
--- /dev/null
+++ b/0075-configure-disable-various-modules-on-MINGW.patch
@@ -0,0 +1,24 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:51.861172533 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:51.867269837 +0200
+@@ -8363,6 +8363,20 @@ AS_CASE([$ac_sys_system],
+     )
+   ],
+   [CYGWIN*], [PY_STDLIB_MOD_SET_NA([_scproxy])],
++  [MINGW*], [
++    PY_STDLIB_MOD_SET_NA(
++      [readline],
++      [_posixshmem],
++      [_posixsubprocess],
++      [fcntl],
++      [grp],
++      [pwd],
++      [resource],
++      [syslog],
++      [termios],
++      [_scproxy],
++    )
++  ],
+   [QNX*], [PY_STDLIB_MOD_SET_NA([_scproxy])],
+   [FreeBSD*], [PY_STDLIB_MOD_SET_NA([_scproxy])],
+   [Emscripten], [

diff --git a/0076-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch b/0076-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch
new file mode 100644
index 0000000..6886313
--- /dev/null
+++ b/0076-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch
@@ -0,0 +1,34 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:52.151413870 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:52.156249680 +0200
+@@ -4629,6 +4629,12 @@ AS_CASE([$MACHDEP],
+   [SELECTMODULE_LIBS=""]
+ )
+ 
++dnl On MINGW, you need to link againt ole32, oleaut32 and uuid for ctypes
++AS_CASE([$MACHDEP],
++  [win32], [CTYPES_LIBS="-lole32 -loleaut32 -luuid"],
++  [CTYPES_LIBS=""]
++)
++
+ dnl detect sqlite3 from Emscripten emport
+ PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
+ 
+@@ -8754,7 +8760,7 @@ PY_HACL_CREATE_MODULE([HMAC], [_hmac], [
+ 
+ PY_STDLIB_MOD([_ctypes],
+   [], [test "$have_libffi" = yes],
+-  [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS])
++  [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS $CTYPES_LIBS])
+ PY_STDLIB_MOD([_curses],
+   [], [test "$have_curses" = "yes"],
+   [$CURSES_CFLAGS], [$CURSES_LIBS]
+@@ -8833,7 +8839,7 @@ dnl Check have_libffi so _ctypes_test is
+ dnl _ctypes_test doesn't use libffi directly.
+ PY_STDLIB_MOD([_ctypes_test],
+   [test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$have_dynamic_loading" = yes],
+-  [], [$LIBM])
++  [], [$LIBM $CTYPES_LIBS])
+ 
+ dnl Limited API template modules.
+ dnl Emscripten does not support shared libraries yet.

diff --git a/0077-configure-Enable-_uuid-on-MINGW.patch b/0077-configure-Enable-_uuid-on-MINGW.patch
new file mode 100644
index 0000000..33fff5c
--- /dev/null
+++ b/0077-configure-Enable-_uuid-on-MINGW.patch
@@ -0,0 +1,27 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:52.442229731 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:52.447229382 +0200
+@@ -4635,6 +4635,12 @@ AS_CASE([$MACHDEP],
+   [CTYPES_LIBS=""]
+ )
+ 
++dnl On MINGW, you need to link againt rpcrt4 for _uuid
++AS_CASE([$MACHDEP],
++  [win32], [UUID_LIBS="-lrpcrt4"],
++  [UUID_LIBS=""]
++)
++
+ dnl detect sqlite3 from Emscripten emport
+ PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
+ 
+@@ -8789,8 +8795,8 @@ PY_STDLIB_MOD([_tkinter],
+   [], [test "$have_tcltk" = "yes"],
+   [$TCLTK_CFLAGS], [$TCLTK_LIBS])
+ PY_STDLIB_MOD([_uuid],
+-  [], [test "$have_uuid" = "yes"],
+-  [$LIBUUID_CFLAGS], [$LIBUUID_LIBS])
++  [], [test "$have_uuid" = "yes" -o "$MACHDEP" = "win32"],
++  [$LIBUUID_CFLAGS], [$LIBUUID_LIBS $UUID_LIBS])
+ 
+ dnl compression libs
+ PY_STDLIB_MOD([zlib], [], [test "$have_zlib" = yes],

diff --git a/0078-configure-make-incompatible-pointer-types-a-warning.patch b/0078-configure-make-incompatible-pointer-types-a-warning.patch
new file mode 100644
index 0000000..ba49ee2
--- /dev/null
+++ b/0078-configure-make-incompatible-pointer-types-a-warning.patch
@@ -0,0 +1,18 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:52.737209155 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:52.741208876 +0200
+@@ -2653,6 +2653,14 @@ fi
+ AS_VAR_IF([ac_cv_gcc_compat], [yes], [
+     CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
+ 
++    # GCC 14 and later error out with incompatible-pointer-types
++    # this only occues on mingw
++    case $host in
++    *-*-mingw*)
++        CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
++      ;;
++    esac
++
+     PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
+     AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
+               [CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])

diff --git a/0079-tests-test_makefile-normalize-path.patch b/0079-tests-test_makefile-normalize-path.patch
new file mode 100644
index 0000000..c6b85b1
--- /dev/null
+++ b/0079-tests-test_makefile-normalize-path.patch
@@ -0,0 +1,18 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_tools/test_makefile.py Python-3.14.7-new/Lib/test/test_tools/test_makefile.py
+--- Python-3.14.7/Lib/test/test_tools/test_makefile.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_tools/test_makefile.py	2026-09-22 09:06:53.032632129 +0200
+@@ -33,12 +33,13 @@ class TestMakefile(unittest.TestCase):
+                     if '\t' not in line:
+                         break
+                     result.append(line.replace('\\', '').strip())
++        result = [os.path.normpath(d) for d in result if d]
+         return result
+ 
+     @unittest.skipUnless(support.TEST_MODULES_ENABLED, "requires test modules")
+     def test_makefile_test_folders(self):
+         test_dirs = self.list_test_dirs()
+-        idle_test = 'idlelib/idle_test'
++        idle_test = os.path.join('idlelib', 'idle_test')
+         self.assertIn(idle_test, test_dirs)
+ 
+         used = set([idle_test])

diff --git a/0080-Fix-include-naming-for-cross-build.patch b/0080-Fix-include-naming-for-cross-build.patch
new file mode 100644
index 0000000..45d6c3d
--- /dev/null
+++ b/0080-Fix-include-naming-for-cross-build.patch
@@ -0,0 +1,63 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_ctypes/ctypes.h Python-3.14.7-new/Modules/_ctypes/ctypes.h
+--- Python-3.14.7/Modules/_ctypes/ctypes.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_ctypes/ctypes.h	2026-09-22 09:06:53.319705479 +0200
+@@ -56,7 +56,7 @@
+ #endif
+ 
+ #ifdef MS_WIN32
+-#include <Unknwn.h> // for IUnknown interface
++#include <unknwn.h> // for IUnknown interface
+ #endif
+ 
+ typedef struct {
+diff -rupN --no-dereference Python-3.14.7/Modules/posixmodule.c Python-3.14.7-new/Modules/posixmodule.c
+--- Python-3.14.7/Modules/posixmodule.c	2026-09-22 09:06:38.835178798 +0200
++++ Python-3.14.7-new/Modules/posixmodule.c	2026-09-22 09:06:53.321168421 +0200
+@@ -9499,7 +9499,7 @@ os_setpgrp_impl(PyObject *module)
+ 
+ #ifdef MS_WINDOWS
+ #include <winternl.h>
+-#include <ProcessSnapshot.h>
++#include <processsnapshot.h>
+ 
+ // The structure definition in winternl.h may be incomplete.
+ // This structure is the full version from the MSDN documentation.
+diff -rupN --no-dereference Python-3.14.7/Modules/socketmodule.c Python-3.14.7-new/Modules/socketmodule.c
+--- Python-3.14.7/Modules/socketmodule.c	2026-09-22 09:06:35.035075612 +0200
++++ Python-3.14.7-new/Modules/socketmodule.c	2026-09-22 09:06:53.322197472 +0200
+@@ -286,7 +286,7 @@ shutdown(how) -- shut down traffic in on
+ # endif
+ 
+ /* Helpers needed for AF_HYPERV */
+-# include <Rpc.h>
++# include <rpc.h>
+ 
+ /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */
+ #ifdef _MSC_VER
+diff -rupN --no-dereference Python-3.14.7/PC/_testconsole.c Python-3.14.7-new/PC/_testconsole.c
+--- Python-3.14.7/PC/_testconsole.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/_testconsole.c	2026-09-22 09:06:53.322822684 +0200
+@@ -140,7 +140,7 @@ _testconsole_read_output_impl(PyObject *
+ }
+ 
+ 
+-#include "clinic\_testconsole.c.h"
++#include "clinic/_testconsole.c.h"
+ 
+ PyMethodDef testconsole_methods[] = {
+     _TESTCONSOLE_WRITE_INPUT_METHODDEF
+diff -rupN --no-dereference Python-3.14.7/PC/_wmimodule.cpp Python-3.14.7-new/PC/_wmimodule.cpp
+--- Python-3.14.7/PC/_wmimodule.cpp	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/PC/_wmimodule.cpp	2026-09-22 09:06:53.322999682 +0200
+@@ -14,9 +14,9 @@
+ #endif
+ 
+ #define _WIN32_DCOM
+-#include <Windows.h>
++#include <windows.h>
+ #include <comdef.h>
+-#include <Wbemidl.h>
++#include <wbemidl.h>
+ #include <propvarutil.h>
+ 
+ #include <Python.h>

diff --git a/0081-Fix-format-warning.patch b/0081-Fix-format-warning.patch
new file mode 100644
index 0000000..9877ce2
--- /dev/null
+++ b/0081-Fix-format-warning.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_ctypes/_ctypes.c Python-3.14.7-new/Modules/_ctypes/_ctypes.c
+--- Python-3.14.7/Modules/_ctypes/_ctypes.c	2026-09-22 09:06:36.777989235 +0200
++++ Python-3.14.7-new/Modules/_ctypes/_ctypes.c	2026-09-22 09:06:53.626877468 +0200
+@@ -5391,7 +5391,7 @@ PyCArrayType_from_ctype(ctypes_state *st
+         return NULL;
+     }
+ #ifdef MS_WIN64
+-    sprintf(name, "%.200s_Array_%Id",
++    sprintf(name, "%.200s_Array_%lld",
+         ((PyTypeObject *)itemtype)->tp_name, length);
+ #else
+     sprintf(name, "%.200s_Array_%ld",

diff --git a/0082-Fix-pragma-warnings.patch b/0082-Fix-pragma-warnings.patch
new file mode 100644
index 0000000..7716a14
--- /dev/null
+++ b/0082-Fix-pragma-warnings.patch
@@ -0,0 +1,46 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_winapi.c Python-3.14.7-new/Modules/_winapi.c
+--- Python-3.14.7/Modules/_winapi.c	2026-09-22 09:06:51.270021350 +0200
++++ Python-3.14.7-new/Modules/_winapi.c	2026-09-22 09:06:53.941125176 +0200
+@@ -1722,14 +1722,18 @@ _winapi_GetVersion_impl(PyObject *module
+ /* Disable deprecation warnings about GetVersionEx as the result is
+    being passed straight through to the caller, who is responsible for
+    using it correctly. */
++#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4996)
++#endif
+ 
+ {
+     return GetVersion();
+ }
+ 
++#ifdef _MSC_VER
+ #pragma warning(pop)
++#endif
+ 
+ /*[clinic input]
+ _winapi.MapViewOfFile -> LPVOID
+diff -rupN --no-dereference Python-3.14.7/Python/sysmodule.c Python-3.14.7-new/Python/sysmodule.c
+--- Python-3.14.7/Python/sysmodule.c	2026-09-22 09:06:40.056093649 +0200
++++ Python-3.14.7-new/Python/sysmodule.c	2026-09-22 09:06:53.941821761 +0200
+@@ -1722,8 +1722,10 @@ _sys_getwindowsversion_from_kernel32(voi
+ /* Disable deprecation warnings about GetVersionEx as the result is
+    being passed straight through to the caller, who is responsible for
+    using it correctly. */
++#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4996)
++#endif
+ 
+ /*[clinic input]
+ sys.getwindowsversion
+@@ -1817,7 +1819,9 @@ error:
+     return NULL;
+ }
+ 
++#ifdef _MSC_VER
+ #pragma warning(pop)
++#endif
+ 
+ /*[clinic input]
+ sys._enablelegacywindowsfsencoding

diff --git a/0083-math-pyhash-MINGW-support.patch b/0083-math-pyhash-MINGW-support.patch
new file mode 100644
index 0000000..8e59ea6
--- /dev/null
+++ b/0083-math-pyhash-MINGW-support.patch
@@ -0,0 +1,33 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/mathmodule.c Python-3.14.7-new/Modules/mathmodule.c
+--- Python-3.14.7/Modules/mathmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/mathmodule.c	2026-09-22 09:06:54.238883135 +0200
+@@ -2166,7 +2166,7 @@ math_ldexp_impl(PyObject *module, double
+     } else {
+         errno = 0;
+         r = ldexp(x, (int)exp);
+-#ifdef _MSC_VER
++#ifdef _WIN32
+         if (DBL_MIN > r && r > -DBL_MIN) {
+             /* Denormal (or zero) results can be incorrectly rounded here (rather,
+                truncated).  Fixed in newer versions of the C runtime, included
+@@ -2406,7 +2406,7 @@ math_fmod_impl(PyObject *module, double
+         return PyFloat_FromDouble(x);
+     errno = 0;
+     r = fmod(x, y);
+-#ifdef _MSC_VER
++#ifdef _WIN32
+     /* Windows (e.g. Windows 10 with MSC v.1916) loose sign
+        for zero result.  But C99+ says: "if y is nonzero, the result
+        has the same sign as x".
+diff -rupN --no-dereference Python-3.14.7/Python/pyhash.c Python-3.14.7-new/Python/pyhash.c
+--- Python-3.14.7/Python/pyhash.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Python/pyhash.c	2026-09-22 09:06:54.239380324 +0200
+@@ -218,7 +218,7 @@ PyHash_GetFuncDef(void)
+ }
+ 
+ /* Optimized memcpy() for Windows */
+-#ifdef _MSC_VER
++#ifdef _WIN32
+ #  if SIZEOF_PY_UHASH_T == 4
+ #    define PY_UHASH_CPY(dst, src) do {                                    \
+        dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \

diff --git a/0084-tests-Fix-test-for-library-name.patch b/0084-tests-Fix-test-for-library-name.patch
new file mode 100644
index 0000000..1cddaf6
--- /dev/null
+++ b/0084-tests-Fix-test-for-library-name.patch
@@ -0,0 +1,18 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_sysconfig.py Python-3.14.7-new/Lib/test/test_sysconfig.py
+--- Python-3.14.7/Lib/test/test_sysconfig.py	2026-09-22 09:06:45.707511973 +0200
++++ Python-3.14.7-new/Lib/test/test_sysconfig.py	2026-09-22 09:06:54.530382885 +0200
+@@ -471,8 +471,12 @@ class TestSysConfig(unittest.TestCase, V
+         major, minor = sys.version_info[:2]
+         abiflags = sysconfig.get_config_var('ABIFLAGS')
+         if sys.platform.startswith('win'):
+-            self.assertEqual(library, f'python{major}{minor}{abiflags}.dll')
+-            self.assertEqual(library, ldlibrary)
++            if sys._is_mingw:
++                self.assertEqual(library, f'libpython{major}.{minor}{abiflags}.a')
++                self.assertEqual(ldlibrary, f'libpython{major}.{minor}{abiflags}.dll.a')
++            else:
++                self.assertEqual(library, f'python{major}{minor}{abiflags}.dll')
++                self.assertEqual(library, ldlibrary)
+         elif is_apple_mobile:
+             framework = sysconfig.get_config_var('PYTHONFRAMEWORK')
+             self.assertEqual(ldlibrary, f"{framework}.framework/{framework}")

diff --git a/0085-dictobject-MINGW-support.patch b/0085-dictobject-MINGW-support.patch
new file mode 100644
index 0000000..e5de0e0
--- /dev/null
+++ b/0085-dictobject-MINGW-support.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Objects/dictobject.c Python-3.14.7-new/Objects/dictobject.c
+--- Python-3.14.7/Objects/dictobject.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Objects/dictobject.c	2026-09-22 09:06:54.827063376 +0200
+@@ -549,7 +549,7 @@ calculate_log2_keysize(Py_ssize_t minsiz
+ #if SIZEOF_LONG == SIZEOF_SIZE_T
+     minsize = Py_MAX(minsize, PyDict_MINSIZE);
+     return _Py_bit_length(minsize - 1);
+-#elif defined(_MSC_VER)
++#elif defined(MS_WINDOWS)
+     // On 64bit Windows, sizeof(long) == 4. We cannot use _Py_bit_length.
+     minsize = Py_MAX(minsize, PyDict_MINSIZE);
+     unsigned long msb;

diff --git a/0086-build-Fix-export-Py_GetBuildInfo-symbol.patch b/0086-build-Fix-export-Py_GetBuildInfo-symbol.patch
new file mode 100644
index 0000000..2d4f99e
--- /dev/null
+++ b/0086-build-Fix-export-Py_GetBuildInfo-symbol.patch
@@ -0,0 +1,15 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:50.979959903 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:55.116784695 +0200
+@@ -1961,8 +1961,9 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+ 		$(MODULE_OBJS) \
+ 		$(MODOBJS) \
+ 		$(DTRACE_OBJS) \
+-		$(srcdir)/Modules/getbuildinfo.c
+-	$(CC) -c $(PY_CORE_CFLAGS) \
++		$(srcdir)/Modules/getbuildinfo.c \
++		$(PYTHON_HEADERS)
++	$(CC) -c $(PY_BUILTIN_MODULE_CFLAGS) \
+ 	      -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
+ 	      -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
+ 	      -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \

diff --git a/0087-build-Allow-profile-tests-failure.patch b/0087-build-Allow-profile-tests-failure.patch
new file mode 100644
index 0000000..1065055
--- /dev/null
+++ b/0087-build-Allow-profile-tests-failure.patch
@@ -0,0 +1,21 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:55.402023268 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:55.406589411 +0200
+@@ -877,7 +877,7 @@ profile-run-stamp:
+ 	$(MAKE) profile-gen-stamp
+ 	# Next, run the profile task to generate the profile information.
+ 	@ # FIXME: can't run for a cross build
+-	$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
++	$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
+ 	$(LLVM_PROF_MERGER)
+ 	# Remove profile generation binary since we are done with it.
+ 	$(MAKE) clean-retain-profile
+@@ -926,7 +926,7 @@ profile-bolt-stamp: $(BUILDPYTHON)
+ 	  mv "$${bin}.bolt_inst" "$${bin}"; \
+ 	done
+ 	# Run instrumented binaries to collect data.
+-	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
++	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
+ 	# Merge all the data files together.
+ 	for bin in $(BOLT_BINARIES); do \
+ 	  @MERGE_FDATA@ $${bin}.*.fdata > "$${bin}.fdata"; \

diff --git a/0088-build-add-support-for-building-C-modules.patch b/0088-build-add-support-for-building-C-modules.patch
new file mode 100644
index 0000000..7aa15b3
--- /dev/null
+++ b/0088-build-add-support-for-building-C-modules.patch
@@ -0,0 +1,72 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:55.693002970 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:55.697979343 +0200
+@@ -104,6 +104,7 @@ CONFIGURE_LDFLAGS=	@LDFLAGS@
+ # values.
+ PY_CFLAGS=	$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
+ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal -I$(srcdir)/Include/internal/mimalloc
++PY_CXXFLAGS_NODIST=$(filter-out -std=c11,$(PY_CFLAGS_NODIST)) -std=c++20
+ # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
+ # be able to build extension modules using the directories specified in the
+ # environment variables
+@@ -121,7 +122,9 @@ ARFLAGS=	@ARFLAGS@
+ CFLAGSFORSHARED=@CFLAGSFORSHARED@
+ # C flags used for building the interpreter object files
+ PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
++PY_STDMODULE_CXXFLAGS= $(PY_CFLAGS) $(PY_CXXFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
+ PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
++PY_BUILTIN_MODULE_CXXFLAGS= $(PY_STDMODULE_CXXFLAGS) -DPy_BUILD_CORE_BUILTIN
+ PY_CORE_CFLAGS=	$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
+ # Linker flags used for building the interpreter object files
+ PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
+@@ -187,7 +190,7 @@ EXT_SUFFIX=	@EXT_SUFFIX@
+ PYD_PLATFORM_TAG = @PYD_PLATFORM_TAG@
+ LDSHARED=	@LDSHARED@ $(PY_LDFLAGS)
+ BLDSHARED=	@BLDSHARED@ $(PY_CORE_LDFLAGS)
+-LDCXXSHARED=	@LDCXXSHARED@ $(PY_LDFLAGS)
++LDCXXSHARED=	@LDCXXSHARED@ $(PY_CORE_LDFLAGS)
+ DESTSHARED=	$(BINLIBDEST)/lib-dynload
+ 
+ # List of exported symbols for AIX
+diff -rupN --no-dereference Python-3.14.7/Modules/makesetup Python-3.14.7-new/Modules/makesetup
+--- Python-3.14.7/Modules/makesetup	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/makesetup	2026-09-22 09:06:55.698456841 +0200
+@@ -228,13 +228,13 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
+ 		for src in $srcs
+ 		do
+ 			case $src in
+-			*.c)   obj=`basename $src .c`.o; cc='$(CC)';;
+-			*.cc)  obj=`basename $src .cc`.o; cc='$(CXX)';;
+-			*.c++) obj=`basename $src .c++`.o; cc='$(CXX)';;
+-			*.C)   obj=`basename $src .C`.o; cc='$(CXX)';;
+-			*.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)';;
+-			*.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)';;
+-			*.m)   obj=`basename $src .m`.o; cc='$(CC)';; # Obj-C
++			*.c)   obj=`basename $src .c`.o; cc='$(CC)'; ccld='$(BLDSHARED)'; ccflags='$(PY_STDMODULE_CFLAGS)';;
++			*.cc)  obj=`basename $src .cc`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';;
++			*.c++) obj=`basename $src .c++`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';;
++			*.C)   obj=`basename $src .C`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';;
++			*.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';;
++			*.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)'; ccld='$(LDCXXSHARED)'; ccflags='$(PY_STDMODULE_CXXFLAGS)';;
++			*.m)   obj=`basename $src .m`.o; cc='$(CC)'; ccld='$(BLDSHARED)'; ccflags='$(PY_STDMODULE_CFLAGS)';; # Obj-C
+ 			*)     continue;;
+ 			esac
+ 			case $src in
+@@ -251,7 +251,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
+ 			# custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec
+ 			case $doconfig in
+ 			no)
+-				cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)"
++				cc="$cc $cpps $ccflags \$(CCSHARED)"
+ 				rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_SHARED) \$(PYTHON_HEADERS)"
+ 				rule="$rule; $cc -c $src -o $obj"
+ 				;;
+@@ -276,7 +276,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
+ 				;;
+ 			esac
+ 			rule="$file: $objs \$(MODULE_${mods_upper}_LDEPS)"
+-			rule="$rule; \$(BLDSHARED) $objs $libs \$(MODULE_LDFLAGS_SHARED) -o $file"
++			rule="$rule; $ccld $objs $libs \$(MODULE_LDFLAGS_SHARED) -o $file"
+ 			echo "$rule" >>$rulesf
+ 		done
+ 	done

diff --git a/0089-build-build-fix-the-wmi-module.patch b/0089-build-build-fix-the-wmi-module.patch
new file mode 100644
index 0000000..abe4507
--- /dev/null
+++ b/0089-build-build-fix-the-wmi-module.patch
@@ -0,0 +1,57 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:53.028188858 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:55.987982394 +0200
+@@ -8828,6 +8828,8 @@ dnl windows specific modules
+ PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"])
+ PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"])
+ PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"])
++PY_STDLIB_MOD([_wmi], [test "$MACHDEP" = "win32"], [], [],
++  [-lwbemuuid -lpropsys -lole32 -loleaut32 -luuid])
+ PY_STDLIB_MOD([winsound], [test "$MACHDEP" = "win32"], [], [],
+   [-lwinmm])
+ PY_STDLIB_MOD([_overlapped], [test "$MACHDEP" = "win32"], [], [],
+diff -rupN --no-dereference Python-3.14.7/Modules/Setup.stdlib.in Python-3.14.7-new/Modules/Setup.stdlib.in
+--- Python-3.14.7/Modules/Setup.stdlib.in	2026-09-22 09:06:40.954523801 +0200
++++ Python-3.14.7-new/Modules/Setup.stdlib.in	2026-09-22 09:06:55.987506799 +0200
+@@ -171,6 +171,7 @@
+ # Windows specific modules
+ 
+ @MODULE__OVERLAPPED_TRUE@_overlapped overlapped.c
++@MODULE__WMI_TRUE@_wmi ../PC/_wmimodule.cpp
+ @MODULE_WINSOUND_TRUE@winsound ../PC/winsound.c
+ 
+ 
+diff -rupN --no-dereference Python-3.14.7/PC/_wmimodule.cpp Python-3.14.7-new/PC/_wmimodule.cpp
+--- Python-3.14.7/PC/_wmimodule.cpp	2026-09-22 09:06:53.622380639 +0200
++++ Python-3.14.7-new/PC/_wmimodule.cpp	2026-09-22 09:06:55.987729017 +0200
+@@ -100,10 +100,12 @@ _query_thread(LPVOID param)
+         hr = HRESULT_FROM_WIN32(GetLastError());
+     }
+     if (SUCCEEDED(hr)) {
++        BSTR bstr_wql = SysAllocString(L"ROOT\\CIMV2");
+         hr = locator->ConnectServer(
+-            bstr_t(L"ROOT\\CIMV2"),
++            bstr_wql,
+             NULL, NULL, 0, NULL, 0, 0, &services
+         );
++        SysFreeString(bstr_wql);
+     }
+     if (SUCCEEDED(hr) && !SetEvent(data.connectEvent)) {
+         hr = HRESULT_FROM_WIN32(GetLastError());
+@@ -116,13 +118,15 @@ _query_thread(LPVOID param)
+         );
+     }
+     if (SUCCEEDED(hr)) {
++        BSTR bstr_wql = SysAllocString(L"WQL");
+         hr = services->ExecQuery(
+-            bstr_t("WQL"),
++            bstr_wql,
+             bstrQuery,
+             WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
+             NULL,
+             &enumerator
+         );
++        SysFreeString(bstr_wql);
+     }
+ 
+     // Okay, after all that, at this stage we should have an enumerator

diff --git a/0090-Fix-exports-for-_suggestions-module.patch b/0090-Fix-exports-for-_suggestions-module.patch
new file mode 100644
index 0000000..c7d5997
--- /dev/null
+++ b/0090-Fix-exports-for-_suggestions-module.patch
@@ -0,0 +1,11 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/_suggestions.c Python-3.14.7-new/Modules/_suggestions.c
+--- Python-3.14.7/Modules/_suggestions.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/_suggestions.c	2026-09-22 09:06:56.276450598 +0200
+@@ -1,3 +1,7 @@
++#ifndef Py_BUILD_CORE_BUILTIN
++#  define Py_BUILD_CORE_MODULE 1
++#endif
++
+ #include "Python.h"
+ #include "pycore_pyerrors.h"
+ #include "clinic/_suggestions.c.h"

diff --git a/0091-compileall-Normalize-paths.patch b/0091-compileall-Normalize-paths.patch
new file mode 100644
index 0000000..53d3eca
--- /dev/null
+++ b/0091-compileall-Normalize-paths.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/compileall.py Python-3.14.7-new/Lib/compileall.py
+--- Python-3.14.7/Lib/compileall.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/compileall.py	2026-09-22 09:06:56.565562621 +0200
+@@ -161,8 +161,8 @@ def compile_file(fullname, ddir=None, fo
+                           "in combination with stripdir or prependdir"))
+ 
+     success = True
+-    fullname = os.fspath(fullname)
+-    stripdir = os.fspath(stripdir) if stripdir is not None else None
++    fullname = os.path.normpath(os.fspath(fullname))
++    stripdir = os.path.normpath(os.fspath(stripdir)) if stripdir is not None else None
+     name = os.path.basename(fullname)
+ 
+     dfile = None

diff --git a/0092-configure-enable-64-bit-time-support-for-32-bit-buil.patch b/0092-configure-enable-64-bit-time-support-for-32-bit-buil.patch
new file mode 100644
index 0000000..61e2ae6
--- /dev/null
+++ b/0092-configure-enable-64-bit-time-support-for-32-bit-buil.patch
@@ -0,0 +1,17 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:56.271060936 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:56.855921848 +0200
+@@ -1037,6 +1037,13 @@ if test -z "$CFLAGS"; then
+         CFLAGS=
+ fi
+ 
++dnl Build 32-bit mingw-w64 platform with 64-bit time support.
++case $host in
++  i686-*-mingw*)
++    CFLAGS="$CFLAGS -D__MINGW_USE_VC2005_COMPAT"
++    ;;
++esac
++
+ dnl Emscripten SDK and WASI SDK default to wasm32.
+ dnl On Emscripten use MEMORY64 setting to build target wasm64-emscripten.
+ dnl for wasm64.

diff --git a/0093-venv-also-install-the-versioned-launchers.patch b/0093-venv-also-install-the-versioned-launchers.patch
new file mode 100644
index 0000000..8b9367f
--- /dev/null
+++ b/0093-venv-also-install-the-versioned-launchers.patch
@@ -0,0 +1,23 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/venv/__init__.py Python-3.14.7-new/Lib/venv/__init__.py
+--- Python-3.14.7/Lib/venv/__init__.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/venv/__init__.py	2026-09-22 09:06:57.145798857 +0200
+@@ -388,8 +388,18 @@ class EnvBuilder:
+                     f'pythonw{exe_t}{exe_d}.exe': pythonw_exe,
+                 }
+ 
++            if sys._is_mingw:
++                for key, value in list(link_sources.items()):
++                    if key.startswith('python'):
++                        link_sources[key.replace('python', 'python3')] = value
++                        link_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
++                for key, value in list(copy_sources.items()):
++                    if key.startswith('python'):
++                        copy_sources[key.replace('python', 'python3')] = value
++                        copy_sources[key.replace('python', f'python3.{sys.version_info[1]}')] = value
++
+             do_copies = True
+-            if self.symlinks:
++            if self.symlinks and not sys._is_mingw:
+                 do_copies = False
+                 # For symlinking, we need all the DLLs to be available alongside
+                 # the executables.

diff --git a/0094-configure-set-_WIN32_WINNT-version.patch b/0094-configure-set-_WIN32_WINNT-version.patch
new file mode 100644
index 0000000..2a9ee56
--- /dev/null
+++ b/0094-configure-set-_WIN32_WINNT-version.patch
@@ -0,0 +1,15 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:57.141105145 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:57.435881390 +0200
+@@ -4962,6 +4962,11 @@ done
+ IFS=$as_save_IFS
+ AC_MSG_RESULT([$DBM_CFLAGS $DBM_LIBS])
+ 
++case $host in
++  *-*-mingw*)
++    CFLAGS_NODIST="$CFLAGS_NODIST -D_WIN32_WINNT=0x0602";;
++esac
++
+ # Templates for things AC_DEFINEd more than once.
+ # For a single AC_DEFINE, no template is needed.
+ AH_TEMPLATE([_REENTRANT],

diff --git a/0095-tests-fix-sysconfig.test_get_platform.patch b/0095-tests-fix-sysconfig.test_get_platform.patch
new file mode 100644
index 0000000..339dce5
--- /dev/null
+++ b/0095-tests-fix-sysconfig.test_get_platform.patch
@@ -0,0 +1,22 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_sysconfig.py Python-3.14.7-new/Lib/test/test_sysconfig.py
+--- Python-3.14.7/Lib/test/test_sysconfig.py	2026-09-22 09:06:54.823206805 +0200
++++ Python-3.14.7-new/Lib/test/test_sysconfig.py	2026-09-22 09:06:57.730091266 +0200
+@@ -253,14 +253,16 @@ class TestSysConfig(unittest.TestCase, V
+         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+                        '[MSC v.1310 32 bit (Intel)]')
+         sys.platform = 'win32'
+-        self.assertEqual(get_platform(), 'win32')
++        if not sys._is_mingw:
++            self.assertEqual(get_platform(), 'win32')
+ 
+         # windows XP, amd64
+         os.name = 'nt'
+         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+                        '[MSC v.1310 32 bit (Amd64)]')
+         sys.platform = 'win32'
+-        self.assertEqual(get_platform(), 'win-amd64')
++        if not sys._is_mingw:
++            self.assertEqual(get_platform(), 'win-amd64')
+ 
+         # macbook
+         os.name = 'posix'

diff --git a/0096-pycore_time-fix-missing-timeval.patch b/0096-pycore_time-fix-missing-timeval.patch
new file mode 100644
index 0000000..abe732c
--- /dev/null
+++ b/0096-pycore_time-fix-missing-timeval.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Include/internal/pycore_time.h Python-3.14.7-new/Include/internal/pycore_time.h
+--- Python-3.14.7/Include/internal/pycore_time.h	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Include/internal/pycore_time.h	2026-09-22 09:06:58.018840724 +0200
+@@ -59,7 +59,7 @@ extern "C" {
+ 
+ #include "pycore_runtime_structs.h" // _PyTimeFraction
+ 
+-#ifdef __clang__
++#ifdef MS_WINDOWS
+ struct timeval;
+ #endif
+ 

diff --git a/0097-mmapmodule-define-DONT_USE_SEH.patch b/0097-mmapmodule-define-DONT_USE_SEH.patch
new file mode 100644
index 0000000..824c45e
--- /dev/null
+++ b/0097-mmapmodule-define-DONT_USE_SEH.patch
@@ -0,0 +1,17 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/mmapmodule.c Python-3.14.7-new/Modules/mmapmodule.c
+--- Python-3.14.7/Modules/mmapmodule.c	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Modules/mmapmodule.c	2026-09-22 09:06:58.306626850 +0200
+@@ -62,6 +62,13 @@ my_getallocationgranularity (void)
+ 
+ #endif
+ 
++#if defined(_DEBUG) || defined(__MINGW32__)
++/* Don't use structured exception handling on Windows if this is defined.
++   MingW, AFAIK, doesn't support it.
++*/
++#define DONT_USE_SEH
++#endif
++
+ #ifdef UNIX
+ #include <sys/mman.h>
+ #include <sys/stat.h>

diff --git a/0098-build-Add-ABIFLAGS-to-targets-when-needed.patch b/0098-build-Add-ABIFLAGS-to-targets-when-needed.patch
new file mode 100644
index 0000000..ce6344e
--- /dev/null
+++ b/0098-build-Add-ABIFLAGS-to-targets-when-needed.patch
@@ -0,0 +1,29 @@
+diff -rupN --no-dereference Python-3.14.7/Makefile.pre.in Python-3.14.7-new/Makefile.pre.in
+--- Python-3.14.7/Makefile.pre.in	2026-09-22 09:06:55.982982742 +0200
++++ Python-3.14.7-new/Makefile.pre.in	2026-09-22 09:06:58.593915284 +0200
+@@ -318,11 +318,11 @@ MACHDEP_OBJS=	@MACHDEP_OBJS@
+ LIBOBJDIR=	Python/
+ LIBOBJS=	@LIBOBJS@
+ 
+-PYTHON=		python$(EXE)
+-BUILDPYTHON=	python$(BUILDEXE)
+-BUILDPYTHONW=	pythonw$(BUILDEXE)
+-BUILDVENVLAUNCHER=	venvlauncher$(BUILDEXE)
+-BUILDVENVWLAUNCHER=	venvwlauncher$(BUILDEXE)
++PYTHON=		python$(ABIFLAGS)$(EXE)
++BUILDPYTHON=	python$(ABIFLAGS)$(BUILDEXE)
++BUILDPYTHONW=	pythonw$(ABIFLAGS)$(BUILDEXE)
++BUILDVENVLAUNCHER=	venvlauncher$(ABIFLAGS)$(BUILDEXE)
++BUILDVENVWLAUNCHER=	venvwlauncher$(ABIFLAGS)$(BUILDEXE)
+ 
+ HOSTRUNNER= @HOSTRUNNER@
+ 
+@@ -2492,7 +2492,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
+ 	done
+ 	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
+-		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
++		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(ABIFLAGS)$(EXE); \
+ 		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python$(LDVERSION)w$(EXE); \
+ 		$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVLAUNCHER); \
+ 		$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/$(BUILDVENVWLAUNCHER); \

diff --git a/0099-sysconfig-patch-nt-schemes-again.patch b/0099-sysconfig-patch-nt-schemes-again.patch
new file mode 100644
index 0000000..643dde3
--- /dev/null
+++ b/0099-sysconfig-patch-nt-schemes-again.patch
@@ -0,0 +1,17 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/sysconfig/__init__.py Python-3.14.7-new/Lib/sysconfig/__init__.py
+--- Python-3.14.7/Lib/sysconfig/__init__.py	2026-09-22 09:06:37.933876151 +0200
++++ Python-3.14.7-new/Lib/sysconfig/__init__.py	2026-09-22 09:06:58.881462988 +0200
+@@ -169,6 +169,13 @@ if _HAS_USER_BASE:
+             },
+     }
+ 
++# XXX: setuptools uses os.name to select the scheme and doesn't use
++# sysconfig, we have to monkey patch the 'nt' scheme for mingw builds
++# until that is fixed
++if os.name == 'nt' and  sys._is_mingw:
++    _INSTALL_SCHEMES['nt'] = _INSTALL_SCHEMES['posix_prefix']
++    _INSTALL_SCHEMES['nt_user'] = _INSTALL_SCHEMES['posix_user']
++
+ _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
+                 'scripts', 'data')
+ 

diff --git a/0100-configure-define-_PYTHREAD_NAME_MAXLEN-for-MINGW.patch b/0100-configure-define-_PYTHREAD_NAME_MAXLEN-for-MINGW.patch
new file mode 100644
index 0000000..42cc3d8
--- /dev/null
+++ b/0100-configure-define-_PYTHREAD_NAME_MAXLEN-for-MINGW.patch
@@ -0,0 +1,11 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:57.724861231 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:59.169050674 +0200
+@@ -8350,6 +8350,7 @@ case "$ac_sys_system" in
+   iOS) _PYTHREAD_NAME_MAXLEN=63;;
+   FreeBSD*) _PYTHREAD_NAME_MAXLEN=19;; # gh-131268
+   OpenBSD*) _PYTHREAD_NAME_MAXLEN=23;; # gh-131268
++  MINGW*) _PYTHREAD_NAME_MAXLEN=32766;;
+   *) _PYTHREAD_NAME_MAXLEN=;;
+ esac
+ if test -n "$_PYTHREAD_NAME_MAXLEN"; then

diff --git a/0101-configure-allow-older-autoconf.patch b/0101-configure-allow-older-autoconf.patch
new file mode 100644
index 0000000..8603017
--- /dev/null
+++ b/0101-configure-allow-older-autoconf.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/configure.ac Python-3.14.7-new/configure.ac
+--- Python-3.14.7/configure.ac	2026-09-22 09:06:59.454160976 +0200
++++ Python-3.14.7-new/configure.ac	2026-09-22 09:06:59.459199081 +0200
+@@ -12,7 +12,7 @@ dnl
+ # Set VERSION so we only need to edit in one place (i.e., here)
+ m4_define([PYTHON_VERSION], [3.14])
+ 
+-AC_PREREQ([2.72])
++AC_PREREQ([2.71])
+ 
+ AC_INIT([python],[PYTHON_VERSION],[https://github.com/python/cpython/issues/])
+ 

diff --git a/0102-tests-allow-sys.abiflags-to-exist.patch b/0102-tests-allow-sys.abiflags-to-exist.patch
new file mode 100644
index 0000000..db0a8bc
--- /dev/null
+++ b/0102-tests-allow-sys.abiflags-to-exist.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Lib/test/test_sys.py Python-3.14.7-new/Lib/test/test_sys.py
+--- Python-3.14.7/Lib/test/test_sys.py	2026-08-05 12:29:49.000000000 +0200
++++ Python-3.14.7-new/Lib/test/test_sys.py	2026-09-22 09:06:59.747720117 +0200
+@@ -720,7 +720,7 @@ class SysModuleTest(unittest.TestCase):
+         self.assertTrue(vi > (1,0,0))
+         self.assertIsInstance(sys.float_repr_style, str)
+         self.assertIn(sys.float_repr_style, ('short', 'legacy'))
+-        if not sys.platform.startswith('win'):
++        if sysconfig.get_config_var("ABIFLAGS") is not None:
+             self.assertIsInstance(sys.abiflags, str)
+         else:
+             self.assertFalse(hasattr(sys, 'abiflags'))

diff --git a/0103-makesetup-make-sure-to-link-the-built-libpython.patch b/0103-makesetup-make-sure-to-link-the-built-libpython.patch
new file mode 100644
index 0000000..87dd042
--- /dev/null
+++ b/0103-makesetup-make-sure-to-link-the-built-libpython.patch
@@ -0,0 +1,12 @@
+diff -rupN --no-dereference Python-3.14.7/Modules/makesetup Python-3.14.7-new/Modules/makesetup
+--- Python-3.14.7/Modules/makesetup	2026-09-22 09:06:55.983935670 +0200
++++ Python-3.14.7-new/Modules/makesetup	2026-09-22 09:07:00.047768443 +0200
+@@ -276,7 +276,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
+ 				;;
+ 			esac
+ 			rule="$file: $objs \$(MODULE_${mods_upper}_LDEPS)"
+-			rule="$rule; $ccld $objs $libs \$(MODULE_LDFLAGS_SHARED) -o $file"
++			rule="$rule; $ccld $objs \$(MODULE_LDFLAGS_SHARED) $libs -o $file"
+ 			echo "$rule" >>$rulesf
+ 		done
+ 	done

diff --git a/146136.patch b/146136.patch
deleted file mode 100644
index a781e80..0000000
--- a/146136.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Lib/pkgutil.py Python-3.11.16-new/Lib/pkgutil.py
---- Python-3.11.16/Lib/pkgutil.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/pkgutil.py	2026-09-18 19:23:09.745416470 +0200
-@@ -635,6 +635,9 @@ def get_data(package, resource):
-     # signature - an os.path format "filename" starting with the dirname of
-     # the package's __file__
-     parts = resource.split('/')
-+    if os.path.isabs(resource) or '..' in parts:
-+        raise ValueError("resource must be a relative path with no "
-+                         "parent directory components")
-     parts.insert(0, os.path.dirname(mod.__file__))
-     resource_name = os.path.join(*parts)
-     return loader.get_data(resource_name)
-diff -rupN --no-dereference Python-3.11.16/Lib/test/test_pkgutil.py Python-3.11.16-new/Lib/test/test_pkgutil.py
---- Python-3.11.16/Lib/test/test_pkgutil.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/test/test_pkgutil.py	2026-09-18 19:23:09.745919441 +0200
-@@ -57,6 +57,25 @@ class PkgutilTests(unittest.TestCase):
- 
-         del sys.modules[pkg]
- 
-+    def test_getdata_path_traversal(self):
-+        pkg = 'test_getdata_traversal'
-+
-+        # Make a package with some resources
-+        package_dir = os.path.join(self.dirname, pkg)
-+        os.mkdir(package_dir)
-+        # Empty init.py
-+        f = open(os.path.join(package_dir, '__init__.py'), "wb")
-+        f.close()
-+
-+        with self.assertRaises(ValueError):
-+            pkgutil.get_data(pkg, '../../../etc/passwd')
-+        with self.assertRaises(ValueError):
-+            pkgutil.get_data(pkg, 'sub/../../../etc/passwd')
-+        with self.assertRaises(ValueError):
-+            pkgutil.get_data(pkg, os.path.abspath('/etc/passwd'))
-+
-+        del sys.modules[pkg]
-+
-     def test_getdata_zipfile(self):
-         zip = 'test_getdata_zipfile.zip'
-         pkg = 'test_getdata_zipfile'
-diff -rupN --no-dereference Python-3.11.16/Misc/NEWS.d/next/Security/2026-03-16-18-07-00.gh-issue-146121.vRbdro.rst Python-3.11.16-new/Misc/NEWS.d/next/Security/2026-03-16-18-07-00.gh-issue-146121.vRbdro.rst
---- Python-3.11.16/Misc/NEWS.d/next/Security/2026-03-16-18-07-00.gh-issue-146121.vRbdro.rst	1970-01-01 01:00:00.000000000 +0100
-+++ Python-3.11.16-new/Misc/NEWS.d/next/Security/2026-03-16-18-07-00.gh-issue-146121.vRbdro.rst	2026-09-18 19:23:09.746283411 +0200
-@@ -0,0 +1,3 @@
-+:func:`pkgutil.get_data` now raises rejects *resource* arguments containing the
-+parent directory components or that is an absolute path.
-+This addresses `CVE-2026-3479 <https://www.cve.org/CVERecord?id=CVE-2026-3479>`_.

diff --git a/CVE-2024-4032.patch b/CVE-2024-4032.patch
deleted file mode 100644
index 15c9f27..0000000
--- a/CVE-2024-4032.patch
+++ /dev/null
@@ -1,325 +0,0 @@
-diff -rupN --no-dereference Python-3.11.9/Doc/library/ipaddress.rst Python-3.11.9-new/Doc/library/ipaddress.rst
---- Python-3.11.9/Doc/library/ipaddress.rst	2024-04-02 10:25:04.000000000 +0200
-+++ Python-3.11.9-new/Doc/library/ipaddress.rst	2024-08-26 10:10:41.043668719 +0200
-@@ -178,18 +178,53 @@ write code that handles both IP versions
- 
-    .. attribute:: is_private
- 
--      ``True`` if the address is allocated for private networks.  See
-+      ``True`` if the address is defined as not globally reachable by
-       iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
--      (for IPv6).
-+      (for IPv6) with the following exceptions:
-+
-+      * ``is_private`` is ``False`` for the shared address space (``100.64.0.0/10``)
-+      * For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+        semantics of the underlying IPv4 addresses and the following condition holds
-+        (see :attr:`IPv6Address.ipv4_mapped`)::
-+
-+            address.is_private == address.ipv4_mapped.is_private
-+
-+      ``is_private`` has value opposite to :attr:`is_global`, except for the shared address space
-+      (``100.64.0.0/10`` range) where they are both ``False``.
-+
-+      .. versionchanged:: 3.11.10
-+
-+         Fixed some false positives and false negatives.
-+
-+         * ``192.0.0.0/24`` is considered private with the exception of ``192.0.0.9/32`` and
-+           ``192.0.0.10/32`` (previously: only the ``192.0.0.0/29`` sub-range was considered private).
-+         * ``64:ff9b:1::/48`` is considered private.
-+         * ``2002::/16`` is considered private.
-+         * There are exceptions within ``2001::/23`` (otherwise considered private): ``2001:1::1/128``,
-+           ``2001:1::2/128``, ``2001:3::/32``, ``2001:4:112::/48``, ``2001:20::/28``, ``2001:30::/28``.
-+           The exceptions are not considered private.
- 
-    .. attribute:: is_global
- 
--      ``True`` if the address is allocated for public networks.  See
-+      ``True`` if the address is defined as globally reachable by
-       iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
--      (for IPv6).
-+      (for IPv6) with the following exception:
-+
-+      For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+      semantics of the underlying IPv4 addresses and the following condition holds
-+      (see :attr:`IPv6Address.ipv4_mapped`)::
-+
-+         address.is_global == address.ipv4_mapped.is_global
-+
-+      ``is_global`` has value opposite to :attr:`is_private`, except for the shared address space
-+      (``100.64.0.0/10`` range) where they are both ``False``.
- 
-       .. versionadded:: 3.4
- 
-+      .. versionchanged:: 3.11.10
-+
-+         Fixed some false positives and false negatives, see :attr:`is_private` for details.
-+
-    .. attribute:: is_unspecified
- 
-       ``True`` if the address is unspecified.  See :RFC:`5735` (for IPv4)
-diff -rupN --no-dereference Python-3.11.9/Doc/whatsnew/3.11.rst Python-3.11.9-new/Doc/whatsnew/3.11.rst
---- Python-3.11.9/Doc/whatsnew/3.11.rst	2024-04-02 10:25:04.000000000 +0200
-+++ Python-3.11.9-new/Doc/whatsnew/3.11.rst	2024-08-26 10:10:41.043668719 +0200
-@@ -2727,3 +2727,12 @@ OpenSSL
- * Windows builds and macOS installers from python.org now use OpenSSL 3.0.
- 
- .. _libb2: https://www.blake2.net/
-+
-+Notable changes in 3.11.10
-+==========================
-+
-+ipaddress
-+---------
-+
-+* Fixed ``is_global`` and ``is_private`` behavior in ``IPv4Address``,
-+  ``IPv6Address``, ``IPv4Network`` and ``IPv6Network``.
-diff -rupN --no-dereference Python-3.11.9/Lib/ipaddress.py Python-3.11.9-new/Lib/ipaddress.py
---- Python-3.11.9/Lib/ipaddress.py	2024-04-02 10:25:04.000000000 +0200
-+++ Python-3.11.9-new/Lib/ipaddress.py	2024-08-26 10:10:41.043668719 +0200
-@@ -1086,7 +1086,11 @@ class _BaseNetwork(_IPAddressBase):
-         """
-         return any(self.network_address in priv_network and
-                    self.broadcast_address in priv_network
--                   for priv_network in self._constants._private_networks)
-+                   for priv_network in self._constants._private_networks) and all(
-+                    self.network_address not in network and
-+                    self.broadcast_address not in network
-+                    for network in self._constants._private_networks_exceptions
-+                )
- 
-     @property
-     def is_global(self):
-@@ -1333,18 +1337,41 @@ class IPv4Address(_BaseV4, _BaseAddress)
-     @property
-     @functools.lru_cache()
-     def is_private(self):
--        """Test if this address is allocated for private networks.
--
--        Returns:
--            A boolean, True if the address is reserved per
--            iana-ipv4-special-registry.
--
--        """
--        return any(self in net for net in self._constants._private_networks)
-+        """``True`` if the address is defined as not globally reachable by
-+        iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
-+        (for IPv6) with the following exceptions:
-+
-+        * ``is_private`` is ``False`` for ``100.64.0.0/10``
-+        * For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+            semantics of the underlying IPv4 addresses and the following condition holds
-+            (see :attr:`IPv6Address.ipv4_mapped`)::
-+
-+                address.is_private == address.ipv4_mapped.is_private
-+
-+        ``is_private`` has value opposite to :attr:`is_global`, except for the ``100.64.0.0/10``
-+        IPv4 range where they are both ``False``.
-+        """
-+        return (
-+            any(self in net for net in self._constants._private_networks)
-+            and all(self not in net for net in self._constants._private_networks_exceptions)
-+        )
- 
-     @property
-     @functools.lru_cache()
-     def is_global(self):
-+        """``True`` if the address is defined as globally reachable by
-+        iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
-+        (for IPv6) with the following exception:
-+
-+        For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+        semantics of the underlying IPv4 addresses and the following condition holds
-+        (see :attr:`IPv6Address.ipv4_mapped`)::
-+
-+            address.is_global == address.ipv4_mapped.is_global
-+
-+        ``is_global`` has value opposite to :attr:`is_private`, except for the ``100.64.0.0/10``
-+        IPv4 range where they are both ``False``.
-+        """
-         return self not in self._constants._public_network and not self.is_private
- 
-     @property
-@@ -1548,13 +1575,15 @@ class _IPv4Constants:
- 
-     _public_network = IPv4Network('100.64.0.0/10')
- 
-+    # Not globally reachable address blocks listed on
-+    # https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
-     _private_networks = [
-         IPv4Network('0.0.0.0/8'),
-         IPv4Network('10.0.0.0/8'),
-         IPv4Network('127.0.0.0/8'),
-         IPv4Network('169.254.0.0/16'),
-         IPv4Network('172.16.0.0/12'),
--        IPv4Network('192.0.0.0/29'),
-+        IPv4Network('192.0.0.0/24'),
-         IPv4Network('192.0.0.170/31'),
-         IPv4Network('192.0.2.0/24'),
-         IPv4Network('192.168.0.0/16'),
-@@ -1565,6 +1594,11 @@ class _IPv4Constants:
-         IPv4Network('255.255.255.255/32'),
-         ]
- 
-+    _private_networks_exceptions = [
-+        IPv4Network('192.0.0.9/32'),
-+        IPv4Network('192.0.0.10/32'),
-+    ]
-+
-     _reserved_network = IPv4Network('240.0.0.0/4')
- 
-     _unspecified_address = IPv4Address('0.0.0.0')
-@@ -2010,27 +2044,42 @@ class IPv6Address(_BaseV6, _BaseAddress)
-     @property
-     @functools.lru_cache()
-     def is_private(self):
--        """Test if this address is allocated for private networks.
-+        """``True`` if the address is defined as not globally reachable by
-+        iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
-+        (for IPv6) with the following exceptions:
-+
-+        * ``is_private`` is ``False`` for ``100.64.0.0/10``
-+        * For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+            semantics of the underlying IPv4 addresses and the following condition holds
-+            (see :attr:`IPv6Address.ipv4_mapped`)::
- 
--        Returns:
--            A boolean, True if the address is reserved per
--            iana-ipv6-special-registry, or is ipv4_mapped and is
--            reserved in the iana-ipv4-special-registry.
-+                address.is_private == address.ipv4_mapped.is_private
- 
-+        ``is_private`` has value opposite to :attr:`is_global`, except for the ``100.64.0.0/10``
-+        IPv4 range where they are both ``False``.
-         """
-         ipv4_mapped = self.ipv4_mapped
-         if ipv4_mapped is not None:
-             return ipv4_mapped.is_private
--        return any(self in net for net in self._constants._private_networks)
-+        return (
-+            any(self in net for net in self._constants._private_networks)
-+            and all(self not in net for net in self._constants._private_networks_exceptions)
-+        )
- 
-     @property
-     def is_global(self):
--        """Test if this address is allocated for public networks.
-+        """``True`` if the address is defined as globally reachable by
-+        iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_
-+        (for IPv6) with the following exception:
-+
-+        For IPv4-mapped IPv6-addresses the ``is_private`` value is determined by the
-+        semantics of the underlying IPv4 addresses and the following condition holds
-+        (see :attr:`IPv6Address.ipv4_mapped`)::
- 
--        Returns:
--            A boolean, true if the address is not reserved per
--            iana-ipv6-special-registry.
-+            address.is_global == address.ipv4_mapped.is_global
- 
-+        ``is_global`` has value opposite to :attr:`is_private`, except for the ``100.64.0.0/10``
-+        IPv4 range where they are both ``False``.
-         """
-         return not self.is_private
- 
-@@ -2271,19 +2320,31 @@ class _IPv6Constants:
- 
-     _multicast_network = IPv6Network('ff00::/8')
- 
-+    # Not globally reachable address blocks listed on
-+    # https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
-     _private_networks = [
-         IPv6Network('::1/128'),
-         IPv6Network('::/128'),
-         IPv6Network('::ffff:0:0/96'),
-+        IPv6Network('64:ff9b:1::/48'),
-         IPv6Network('100::/64'),
-         IPv6Network('2001::/23'),
--        IPv6Network('2001:2::/48'),
-         IPv6Network('2001:db8::/32'),
--        IPv6Network('2001:10::/28'),
-+        # IANA says N/A, let's consider it not globally reachable to be safe
-+        IPv6Network('2002::/16'),
-         IPv6Network('fc00::/7'),
-         IPv6Network('fe80::/10'),
-         ]
- 
-+    _private_networks_exceptions = [
-+        IPv6Network('2001:1::1/128'),
-+        IPv6Network('2001:1::2/128'),
-+        IPv6Network('2001:3::/32'),
-+        IPv6Network('2001:4:112::/48'),
-+        IPv6Network('2001:20::/28'),
-+        IPv6Network('2001:30::/28'),
-+    ]
-+
-     _reserved_networks = [
-         IPv6Network('::/8'), IPv6Network('100::/8'),
-         IPv6Network('200::/7'), IPv6Network('400::/6'),
-diff -rupN --no-dereference Python-3.11.9/Lib/test/test_ipaddress.py Python-3.11.9-new/Lib/test/test_ipaddress.py
---- Python-3.11.9/Lib/test/test_ipaddress.py	2024-04-02 10:25:04.000000000 +0200
-+++ Python-3.11.9-new/Lib/test/test_ipaddress.py	2024-08-26 10:10:41.044668718 +0200
-@@ -2269,6 +2269,10 @@ class IpaddrUnitTest(unittest.TestCase):
-         self.assertEqual(True, ipaddress.ip_address(
-                 '172.31.255.255').is_private)
-         self.assertEqual(False, ipaddress.ip_address('172.32.0.0').is_private)
-+        self.assertFalse(ipaddress.ip_address('192.0.0.0').is_global)
-+        self.assertTrue(ipaddress.ip_address('192.0.0.9').is_global)
-+        self.assertTrue(ipaddress.ip_address('192.0.0.10').is_global)
-+        self.assertFalse(ipaddress.ip_address('192.0.0.255').is_global)
- 
-         self.assertEqual(True,
-                          ipaddress.ip_address('169.254.100.200').is_link_local)
-@@ -2294,6 +2298,7 @@ class IpaddrUnitTest(unittest.TestCase):
-         self.assertEqual(True, ipaddress.ip_network("169.254.0.0/16").is_private)
-         self.assertEqual(True, ipaddress.ip_network("172.16.0.0/12").is_private)
-         self.assertEqual(True, ipaddress.ip_network("192.0.0.0/29").is_private)
-+        self.assertEqual(False, ipaddress.ip_network("192.0.0.9/32").is_private)
-         self.assertEqual(True, ipaddress.ip_network("192.0.0.170/31").is_private)
-         self.assertEqual(True, ipaddress.ip_network("192.0.2.0/24").is_private)
-         self.assertEqual(True, ipaddress.ip_network("192.168.0.0/16").is_private)
-@@ -2310,8 +2315,8 @@ class IpaddrUnitTest(unittest.TestCase):
-         self.assertEqual(True, ipaddress.ip_network("::/128").is_private)
-         self.assertEqual(True, ipaddress.ip_network("::ffff:0:0/96").is_private)
-         self.assertEqual(True, ipaddress.ip_network("100::/64").is_private)
--        self.assertEqual(True, ipaddress.ip_network("2001::/23").is_private)
-         self.assertEqual(True, ipaddress.ip_network("2001:2::/48").is_private)
-+        self.assertEqual(False, ipaddress.ip_network("2001:3::/48").is_private)
-         self.assertEqual(True, ipaddress.ip_network("2001:db8::/32").is_private)
-         self.assertEqual(True, ipaddress.ip_network("2001:10::/28").is_private)
-         self.assertEqual(True, ipaddress.ip_network("fc00::/7").is_private)
-@@ -2390,6 +2395,20 @@ class IpaddrUnitTest(unittest.TestCase):
-         self.assertEqual(True, ipaddress.ip_address('0::0').is_unspecified)
-         self.assertEqual(False, ipaddress.ip_address('::1').is_unspecified)
- 
-+        self.assertFalse(ipaddress.ip_address('64:ff9b:1::').is_global)
-+        self.assertFalse(ipaddress.ip_address('2001::').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:1::1').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:1::2').is_global)
-+        self.assertFalse(ipaddress.ip_address('2001:2::').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:3::').is_global)
-+        self.assertFalse(ipaddress.ip_address('2001:4::').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:4:112::').is_global)
-+        self.assertFalse(ipaddress.ip_address('2001:10::').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:20::').is_global)
-+        self.assertTrue(ipaddress.ip_address('2001:30::').is_global)
-+        self.assertFalse(ipaddress.ip_address('2001:40::').is_global)
-+        self.assertFalse(ipaddress.ip_address('2002::').is_global)
-+
-         # some generic IETF reserved addresses
-         self.assertEqual(True, ipaddress.ip_address('100::').is_reserved)
-         self.assertEqual(True, ipaddress.ip_network('4000::1/128').is_reserved)
-diff -rupN --no-dereference Python-3.11.9/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst Python-3.11.9-new/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst
---- Python-3.11.9/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst	1970-01-01 01:00:00.000000000 +0100
-+++ Python-3.11.9-new/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst	2024-08-26 10:10:41.044668718 +0200
-@@ -0,0 +1,9 @@
-+Fixed various false positives and false negatives in
-+
-+* :attr:`ipaddress.IPv4Address.is_private` (see these docs for details)
-+* :attr:`ipaddress.IPv4Address.is_global`
-+* :attr:`ipaddress.IPv6Address.is_private`
-+* :attr:`ipaddress.IPv6Address.is_global`
-+
-+Also in the corresponding :class:`ipaddress.IPv4Network` and :class:`ipaddress.IPv6Network`
-+attributes.

diff --git a/e0799352823289fafb8131341abd751923ee9c08.patch b/e0799352823289fafb8131341abd751923ee9c08.patch
deleted file mode 100644
index 964f450..0000000
--- a/e0799352823289fafb8131341abd751923ee9c08.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Misc/NEWS.d/next/Library/2024-06-04-19-03-25.gh-issue-112672.K2XfZH.rst Python-3.11.16-new/Misc/NEWS.d/next/Library/2024-06-04-19-03-25.gh-issue-112672.K2XfZH.rst
---- Python-3.11.16/Misc/NEWS.d/next/Library/2024-06-04-19-03-25.gh-issue-112672.K2XfZH.rst	1970-01-01 01:00:00.000000000 +0100
-+++ Python-3.11.16-new/Misc/NEWS.d/next/Library/2024-06-04-19-03-25.gh-issue-112672.K2XfZH.rst	2026-09-18 19:23:09.492882068 +0200
-@@ -0,0 +1 @@
-+Support building :mod:`tkinter` with Tcl 9.0.
-diff -rupN --no-dereference Python-3.11.16/Modules/_tkinter.c Python-3.11.16-new/Modules/_tkinter.c
---- Python-3.11.16/Modules/_tkinter.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/_tkinter.c	2026-09-18 19:23:09.493180038 +0200
-@@ -66,6 +66,12 @@ Copyright (C) 1994 Steen Lumholt.
- #define USE_DEPRECATED_TOMMATH_API 1
- #endif
- 
-+// As suggested by https://core.tcl-lang.org/tcl/wiki?name=Migrating+C+extensions+to+Tcl+9
-+#ifndef TCL_SIZE_MAX
-+typedef int Tcl_Size;
-+#define TCL_SIZE_MAX INT_MAX
-+#endif
-+
- #if !(defined(MS_WINDOWS) || defined(__CYGWIN__))
- #define HAVE_CREATEFILEHANDLER
- #endif
-@@ -492,7 +498,7 @@ unicodeFromTclString(const char *s)
- static PyObject *
- unicodeFromTclObj(Tcl_Obj *value)
- {
--    int len;
-+    Tcl_Size len;
- #if USE_TCL_UNICODE
-     int byteorder = NATIVE_BYTEORDER;
-     const Tcl_UniChar *u = Tcl_GetUnicodeFromObj(value, &len);
-@@ -520,6 +526,10 @@ class _tkinter.tktimertoken "TkttObject
- 
- /**** Tkapp Object ****/
- 
-+#if TK_MAJOR_VERSION >= 9
-+int Tcl_AppInit(Tcl_Interp *);
-+#endif
-+
- #ifndef WITH_APPINIT
- int
- Tcl_AppInit(Tcl_Interp *interp)
-@@ -1150,7 +1160,7 @@ FromObj(TkappObject *tkapp, Tcl_Obj *val
-     }
- 
-     if (value->typePtr == tkapp->ByteArrayType) {
--        int size;
-+        Tcl_Size size;
-         char *data = (char*)Tcl_GetByteArrayFromObj(value, &size);
-         return PyBytes_FromStringAndSize(data, size);
-     }
-@@ -1184,8 +1194,8 @@ FromObj(TkappObject *tkapp, Tcl_Obj *val
-     }
- 
-     if (value->typePtr == tkapp->ListType) {
--        int size;
--        int i, status;
-+        Tcl_Size i, size;
-+        int status;
-         PyObject *elem;
-         Tcl_Obj *tcl_elem;
- 
-@@ -1250,9 +1260,9 @@ typedef struct Tkapp_CallEvent {
- } Tkapp_CallEvent;
- 
- static void
--Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tcl_Obj** objStore, int objc)
-+Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tcl_Obj** objStore, Tcl_Size objc)
- {
--    int i;
-+    Tcl_Size i;
-     for (i = 0; i < objc; i++)
-         Tcl_DecrRefCount(objv[i]);
-     if (objv != objStore)
-@@ -1263,7 +1273,7 @@ Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tc
-    interpreter thread, which may or may not be the calling thread. */
- 
- static Tcl_Obj**
--Tkapp_CallArgs(PyObject *args, Tcl_Obj** objStore, int *pobjc)
-+Tkapp_CallArgs(PyObject *args, Tcl_Obj** objStore, Tcl_Size *pobjc)
- {
-     Tcl_Obj **objv = objStore;
-     Py_ssize_t objc = 0, i;
-@@ -1311,10 +1321,10 @@ Tkapp_CallArgs(PyObject *args, Tcl_Obj**
-             Tcl_IncrRefCount(objv[i]);
-         }
-     }
--    *pobjc = (int)objc;
-+    *pobjc = (Tcl_Size)objc;
-     return objv;
- finally:
--    Tkapp_CallDeallocArgs(objv, objStore, (int)objc);
-+    Tkapp_CallDeallocArgs(objv, objStore, (Tcl_Size)objc);
-     return NULL;
- }
- 
-@@ -1357,7 +1367,7 @@ Tkapp_CallProc(Tkapp_CallEvent *e, int f
- {
-     Tcl_Obj *objStore[ARGSZ];
-     Tcl_Obj **objv;
--    int objc;
-+    Tcl_Size objc;
-     int i;
-     ENTER_PYTHON
-     objv = Tkapp_CallArgs(e->args, objStore, &objc);
-@@ -1408,7 +1418,7 @@ Tkapp_Call(PyObject *selfptr, PyObject *
- {
-     Tcl_Obj *objStore[ARGSZ];
-     Tcl_Obj **objv = NULL;
--    int objc, i;
-+    Tcl_Size objc;
-     PyObject *res = NULL;
-     TkappObject *self = (TkappObject*)selfptr;
-     int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL;
-@@ -1454,6 +1464,7 @@ Tkapp_Call(PyObject *selfptr, PyObject *
-     else
-     {
- 
-+        int i;
-         objv = Tkapp_CallArgs(args, objStore, &objc);
-         if (!objv)
-             return NULL;
-@@ -2139,13 +2150,12 @@ _tkinter_tkapp_splitlist(TkappObject *se
- /*[clinic end generated code: output=13b51d34386d36fb input=2b2e13351e3c0b53]*/
- {
-     char *list;
--    int argc;
-+    Tcl_Size argc, i;
-     const char **argv;
-     PyObject *v;
--    int i;
- 
-     if (PyTclObject_Check(arg)) {
--        int objc;
-+        Tcl_Size objc;
-         Tcl_Obj **objv;
-         if (Tcl_ListObjGetElements(Tkapp_Interp(self),
-                                    ((PyTclObject*)arg)->value,

diff --git a/mingw-python3.spec b/mingw-python3.spec
index fbfa49f..aeaa84b 100644
--- a/mingw-python3.spec
+++ b/mingw-python3.spec
@@ -4,8 +4,8 @@
 %undefine _auto_set_build_flags
 
 %global pkgname python3
-%global py_ver 3.11
-%global py_ver_nodots 311
+%global py_ver 3.14
+%global py_ver_nodots 314
 %global mingw32_py3_libdir       %{mingw32_libdir}/python%{py_ver}
 %global mingw64_py3_libdir       %{mingw64_libdir}/python%{py_ver}
 %global mingw32_py3_hostlibdir   %{_prefix}/%{mingw32_target}/lib/python%{py_ver}
@@ -23,7 +23,7 @@
 #global pre rc2
 
 Name:          mingw-%{pkgname}
-Version:       3.11.16
+Version:       3.14.7
 Release:       1%{?dist}
 Summary:       MinGW Windows %{pkgname}
 
@@ -38,40 +38,110 @@ Source3:       mingw32_python3.attr
 Source4:       mingw64_python3.attr
 
 
-# Add support for building with mingw
-Patch1:        mingw-python3_platform-mingw.patch
-# Implement setenv for mingw
-Patch2:        mingw-python3_setenv.patch
-# Ignore main program for frozen scripts
-Patch3:        mingw-python3_frozenmain.patch
-# Link resource files and build pythonw.exe
-Patch4:        mingw-python3_pythonw.patch
-# Implement PyThread_get_thread_native_id for mingw-win-pthread
-Patch5:        mingw-python3_pthread_threadid.patch
-# Output list of failed modules to mods_failed.txt so that we can abort the build
-Patch6:        mingw-python3_mods-failed.patch
-# Adapt distutils for cross-compiling
-Patch7:        mingw-python3_distutils.patch
-# Make sysconfigdata.py relocatable
-Patch8:        mingw-python3_make-sysconfigdata.py-relocatable.patch
-# Fix module builds: select, ssl, multiprocessing
-# Disable modules which do not build
-# Fix broken parallel make
-Patch9:        mingw-python3_modules.patch
-# Use POSIX layout
-Patch10:       mingw-python3_posix-layout.patch
-# Enable some modules needed on Windows
-Patch11:       mingw-python3_win-modules.patch
-# Enable the socket module
-Patch12:       mingw-python3_module-socket.patch
-# MinGW fix for select module
-Patch13:       mingw-python3_module-select.patch
-# Add -lpython<VER> to Libs: in pkgconfig (windows extensions need to be linked against libpython)
-Patch14:       mingw-python3_pkgconfig.patch
-# Backport: Fix build with tcl9
-Patch15:       https://github.com/python/cpython/commit/e0799352823289fafb8131341abd751923ee9c08.patch
-# Backport fix for CVE-2026-3479
-Patch24:       https://github.com/python/cpython/pull/146136.patch
+# From https://packages.msys2.org/packages/mingw-w64-x86_64-python
+Patch:         0001-build-add-with-nt-threads-and-make-it-default-on-min.patch
+Patch:         0002-build-Define-MS_WINDOWS-and-others-when-compiling-wi.patch
+Patch:         0003-sysmodule-Implement-flags-_is_mingw-is_mingw_ucrt-an.patch
+Patch:         0004-configure-add-MACHDEP-and-platform-on-MINGW.patch
+Patch:         0005-build-Add-default-cross-configuration-for-MINGW.patch
+Patch:         0006-configure-enable-largefile-support-by-default-for-Mi.patch
+Patch:         0007-build-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch
+Patch:         0008-build-add-MINGW-support-for-posixmodule.patch
+Patch:         0009-exports.h-Add-support-for-MINGW.patch
+Patch:         0010-configure-add-options-so-that-shared-build-is-possib.patch
+Patch:         0011-build-Add-PYD_PLATFORM_TAG.patch
+Patch:         0012-build-Add-dynload_win-support-for-MinGW.patch
+Patch:         0013-build-Use-.pyd-extension-suffix-fix-import-lib-insta.patch
+Patch:         0014-build-Configure-SOABI-and-EXT_SUFFIX-for-MINGW.patch
+Patch:         0015-build-Define-MS_DLL_ID-for-sys.winver-on-MINGW.patch
+Patch:         0016-build-Ignore-main-program-for-frozen-scripts-on-MING.patch
+Patch:         0017-socketmodule-add-MINGW-support.patch
+Patch:         0018-build-enable-winreg-msvcrt-_winapi-winsound-and-_ove.patch
+Patch:         0019-sysconfig-make-_sysconfigdata.py-relocatable.patch
+Patch:         0020-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch
+Patch:         0021-sysconfig-Change-the-get_platform-method-in-sysconfi.patch
+Patch:         0022-build-semi-native-build-sysconfig.patch
+Patch:         0023-ctypes-Add-support-for-stdcall-without-underscore.patch
+Patch:         0024-ctypes-add-suppor-for-ctypes.pythonapi-under-MINGW.patch
+Patch:         0025-ctypes-find_library-c-should-return-None-with-ucrt.patch
+Patch:         0026-site-Customize-for-MINGW.patch
+Patch:         0027-site-Change-user-site-packages-path-to-include-the-e.patch
+Patch:         0028-python-config-output-Windows-paths-for-the-shell-var.patch
+Patch:         0029-python-config-use-the-Python-variant-of-python-confi.patch
+Patch:         0030-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch
+Patch:         0031-build-Remove-MAXPATHLEN-default.patch
+Patch:         0032-build-dont-link-with-gettext.patch
+Patch:         0033-use-gnu_printf-in-format.patch
+Patch:         0034-build-remove-usage-of-MS_COREDLL.patch
+Patch:         0035-getcompiler-expose-MINGW-toolchain-related-informati.patch
+Patch:         0036-build-fix-signal-module-build.patch
+Patch:         0037-build-build-winconsoleio-and-_testconsole.patch
+Patch:         0038-multiprocessing-expose-sem_unlink-to-fix-multiproces.patch
+Patch:         0039-build-link-win-resource-files-and-build-pythonw.patch
+Patch:         0040-pycore_fileutils-add-MINGW-support.patch
+Patch:         0041-configure-fix-inet_pton-check.patch
+Patch:         0042-importlib-bootstrap-path-sep.patch
+Patch:         0043-configure-set-MINGW-stack-reserve.patch
+Patch:         0044-tests-fix-test_bytes.patch
+Patch:         0045-timemodule-add-MINGW-support.patch
+Patch:         0046-configure-Disable-checks-for-dlopen-dlfcn.patch
+Patch:         0047-venvlauncher-Build-venvlauncher.exe-from-PC-launcher.patch
+Patch:         0048-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
+Patch:         0049-venvlauncher-Skip-find-python-in-Registry-for-mingw-.patch
+Patch:         0050-configure-don-t-check-for-clock_-functions.patch
+Patch:         0051-CI-test-the-build-and-add-some-mingw-specific-tests.patch
+Patch:         0052-configure-Default-to-without-c-locale-coercion-on-Wi.patch
+Patch:         0053-tests-Fix-some-failing-tests.patch
+Patch:         0054-build-def-VPATH-when-compiling-Python-sysmodule.c.patch
+Patch:         0055-configure-correctly-find-native-python.patch
+Patch:         0056-build-Add-extra-flags-for-_bootstrap_python.patch
+Patch:         0057-getpath-add-support-for-mingw.patch
+Patch:         0058-build-Don-t-build-_posixsubprocess-on-Windows.patch
+Patch:         0059-ssl-module-add-MINGW-support.patch
+Patch:         0060-configure-Include-winsock.h-when-checking-for-netdb-.patch
+Patch:         0061-configure-always-build-_multiprocessing-on-Windows.patch
+Patch:         0062-configure-build-mmap-module-on-win32.patch
+Patch:         0063-configure-set-BUILDEXEEXT-and-EXEEXT.patch
+Patch:         0064-configure-fix-building-some-test-modules.patch
+Patch:         0065-Always-convert-to-before-passing-though-pathcch-func.patch
+Patch:         0066-pylifecycle.h-remove-conflicting-_Py_CheckPython3-de.patch
+Patch:         0067-dynload_win-add-env-var-for-reverting-the-legacy-DLL.patch
+Patch:         0068-dynload_win-Port-GetPythonImport-to-MINGW.patch
+Patch:         0069-dynload_win-make-sure-to-only-use-backslashes-for-pa.patch
+Patch:         0070-dynload_win-don-t-run-_Py_CheckPython3-for-MINGW-bui.patch
+Patch:         0071-build-Build-and-install-libpython3.dll-stable-ABI.patch
+Patch:         0072-configure-define-_DEBUG-for-a-debug-build.patch
+Patch:         0073-configure-fix-multiprocessing-module.patch
+Patch:         0074-build-add-MINGW-support-for-selectmodule.patch
+Patch:         0075-configure-disable-various-modules-on-MINGW.patch
+Patch:         0076-configure-Add-libraries-to-fix-ctypes-on-MINGW.patch
+Patch:         0077-configure-Enable-_uuid-on-MINGW.patch
+Patch:         0078-configure-make-incompatible-pointer-types-a-warning.patch
+Patch:         0079-tests-test_makefile-normalize-path.patch
+Patch:         0080-Fix-include-naming-for-cross-build.patch
+Patch:         0081-Fix-format-warning.patch
+Patch:         0082-Fix-pragma-warnings.patch
+Patch:         0083-math-pyhash-MINGW-support.patch
+Patch:         0084-tests-Fix-test-for-library-name.patch
+Patch:         0085-dictobject-MINGW-support.patch
+Patch:         0086-build-Fix-export-Py_GetBuildInfo-symbol.patch
+Patch:         0087-build-Allow-profile-tests-failure.patch
+Patch:         0088-build-add-support-for-building-C-modules.patch
+Patch:         0089-build-build-fix-the-wmi-module.patch
+Patch:         0090-Fix-exports-for-_suggestions-module.patch
+Patch:         0091-compileall-Normalize-paths.patch
+Patch:         0092-configure-enable-64-bit-time-support-for-32-bit-buil.patch
+Patch:         0093-venv-also-install-the-versioned-launchers.patch
+Patch:         0094-configure-set-_WIN32_WINNT-version.patch
+Patch:         0095-tests-fix-sysconfig.test_get_platform.patch
+Patch:         0096-pycore_time-fix-missing-timeval.patch
+Patch:         0097-mmapmodule-define-DONT_USE_SEH.patch
+Patch:         0098-build-Add-ABIFLAGS-to-targets-when-needed.patch
+Patch:         0099-sysconfig-patch-nt-schemes-again.patch
+Patch:         0100-configure-define-_PYTHREAD_NAME_MAXLEN-for-MINGW.patch
+Patch:         0101-configure-allow-older-autoconf.patch
+Patch:         0102-tests-allow-sys.abiflags-to-exist.patch
+Patch:         0103-makesetup-make-sure-to-link-the-built-libpython.patch
 
 
 BuildRequires: make
@@ -193,54 +263,27 @@ autoreconf -vfi
 
 # Ensure that we are using the system copy of various libraries rather than copies shipped in the tarball
 rm -r Modules/expat
-rm -r Modules/_ctypes/{darwin,libffi}*
-
-# Just to be sure that we are using the wanted thread model
-rm -f Python/thread_nt.h
 
 
 %build
-# FIXME: avoid incompatible-pointer-types errors
-export MINGW32_CFLAGS="%{mingw32_cflags} -fpermissive -DTCL_NO_TOMMATH_H"
-export MINGW64_CFLAGS="%{mingw64_cflags} -fpermissive -DTCL_NO_TOMMATH_H"
 export MINGW32_MAKE_ARGS="WINDRES=%{mingw32_target}-windres LD=%{mingw32_target}-ld DLLWRAP=%{mingw32_target}-dllwrap"
 export MINGW64_MAKE_ARGS="WINDRES=%{mingw64_target}-windres LD=%{mingw64_target}-ld DLLWRAP=%{mingw64_target}-dllwrap"
 
-CONFIG_SITE=$PWD/config.site-mingw \
 %mingw_configure \
+--with-build-python=%{_bindir}/python%{py_ver} \
 --enable-shared \
---with-build-python=%{_bindir}/python3.11 \
 --with-system-expat \
---with-suffix=.exe \
---enable-loadable-sqlite-extensions \
---with-ensurepip=no
-
-# Create directories needed by build
-mkdir -p build_win32/PC/icons build_win64/PC/icons
+--with-system-libmpdec \
+--without-ensurepip \
+--with-tzpath=%{_datadir}/share/zoneinfo \
+--enable-optimizations
 
 %mingw_make_build
 
-# Abort build if not explicitly disabled modules failed to build
-if [ -e build_win32/mods_failed.txt ]; then
-    echo "The following modules failed to build for win32"
-    cat build_win32/mods_failed.txt
-fi
-if [ -e build_win64/mods_failed.txt ]; then
-    echo "The following modules failed to build for win64"
-    cat build_win64/mods_failed.txt
-fi
-if [ -e build_win32/mods_failed.txt ] || [ -e build_win64/mods_failed.txt ]; then
-    exit 1;
-fi
-
 
 %install
 %mingw_make_install
 
-# Link import library to libdir
-ln -s %{mingw32_py3_libdir}/config-%{py_ver}/libpython%{py_ver}.dll.a %{buildroot}%{mingw32_libdir}/libpython%{py_ver}.dll.a
-ln -s %{mingw64_py3_libdir}/config-%{py_ver}/libpython%{py_ver}.dll.a %{buildroot}%{mingw64_libdir}/libpython%{py_ver}.dll.a
-
 # Copy some useful "stuff"
 install -dm755 %{buildroot}%{mingw32_py3_libdir}/Tools/{i18n,scripts}
 install -dm755 %{buildroot}%{mingw64_py3_libdir}/Tools/{i18n,scripts}
@@ -249,74 +292,14 @@ install -pm755 Tools/i18n/{msgfmt,pygettext}.py %{buildroot}%{mingw64_py3_libdir
 install -pm755 Tools/scripts/{README,*py} %{buildroot}%{mingw32_py3_libdir}/Tools/scripts/
 install -pm755 Tools/scripts/{README,*py} %{buildroot}%{mingw64_py3_libdir}/Tools/scripts/
 
-# Cleanup shebangs
-find %{buildroot}%{mingw32_py3_libdir}/ -name '*.py' | xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/python3|"
-find %{buildroot}%{mingw64_py3_libdir}/ -name '*.py' | xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/python3|"
-
-# Remove references to build directory
-for file in config-%{py_ver}/Makefile _sysconfigdata__win32_.py; do
-    sed -i "s|%{_builddir}|/build|g" %{buildroot}%{mingw32_py3_libdir}/$file
-    sed -i "s|%{_builddir}|/build|g" %{buildroot}%{mingw64_py3_libdir}/$file
-done
-
 # Fix permissons
 find %{buildroot} -type f | xargs chmod 0644
-find %{buildroot} -type f \( -name "*.dll" -o -name "*.exe" \) | xargs chmod 0755
+find %{buildroot} -type f \( -name "*.dll" -o -name "*.exe" -o -name "*.pyd" \) | xargs chmod 0755
 
 # Don't ship manpages
 rm -rf %{buildroot}%{mingw32_mandir}
 rm -rf %{buildroot}%{mingw64_mandir}
 
-# Host site-packages skeleton
-mkdir -p %{buildroot}%{mingw32_py3_hostlibdir}/site-packages
-mkdir -p %{buildroot}%{mingw64_py3_hostlibdir}/site-packages
-
-# Hackishly faked distutils/sysconfig.py
-mkdir -p %{buildroot}%{mingw32_py3_hostlibdir}/distutils
-mkdir -p %{buildroot}%{mingw64_py3_hostlibdir}/distutils
-pushd %{buildroot}%{mingw32_libdir}/python%{py_ver}/distutils/
-for file in *.py; do
-    ln -s %{mingw32_libdir}/python%{py_ver}/distutils/$file %{buildroot}%{mingw32_py3_hostlibdir}/distutils/$file
-done
-popd
-pushd %{buildroot}%{mingw64_libdir}/python%{py_ver}/distutils/
-for file in *.py; do
-    ln -s %{mingw64_libdir}/python%{py_ver}/distutils/$file %{buildroot}%{mingw64_py3_hostlibdir}/distutils/$file
-done
-popd
-ln -s %{mingw32_py3_libdir}/distutils/command %{buildroot}%{mingw32_py3_hostlibdir}/distutils/command
-ln -s %{mingw64_py3_libdir}/distutils/command %{buildroot}%{mingw64_py3_hostlibdir}/distutils/command
-rm %{buildroot}%{mingw32_py3_hostlibdir}/distutils/sysconfig.py
-rm %{buildroot}%{mingw64_py3_hostlibdir}/distutils/sysconfig.py
-
-cat > %{buildroot}%{mingw32_py3_hostlibdir}/distutils/sysconfig.py <<EOF
-import imp
-import os
-_sysconfig = imp.load_source('distutils.sysconfig', '%{mingw32_py3_libdir}/distutils/sysconfig.py')
-from distutils.sysconfig import *
-# Overwrite methods from sysconfig
-if "mingw32" in os.getenv("CC"):
-    get_python_inc = lambda plat_specific=0, prefix=None: "%{mingw32_py3_incdir}"
-    get_python_lib = lambda plat_specific=0, standard_lib=0, prefix=None: "%{mingw32_python3_sitearch}"
-else:
-    get_python_inc = lambda plat_specific=0, prefix=None: "%{_includedir}/python%{py_ver}"
-    get_python_lib = lambda plat_specific=0, standard_lib=0, prefix=None: "%{_libdir}/python%{py_ver}/site-packages"
-EOF
-
-cat > %{buildroot}%{mingw64_py3_hostlibdir}/distutils/sysconfig.py <<EOF
-import imp
-import os
-_sysconfig = imp.load_source('distutils.sysconfig', '%{mingw64_py3_libdir}/distutils/sysconfig.py')
-from distutils.sysconfig import *
-# Overwrite methods from sysconfig
-if "mingw32" in os.getenv("CC"):
-    get_python_inc = lambda plat_specific=0, prefix=None: "%{mingw64_py3_incdir}"
-    get_python_lib = lambda plat_specific=0, standard_lib=0, prefix=None: "%{mingw64_python3_sitearch}"
-else:
-    get_python_inc = lambda plat_specific=0, prefix=None: "%{_includedir}/python%{py_ver}"
-    get_python_lib = lambda plat_specific=0, standard_lib=0, prefix=None: "%{_libdir}/python%{py_ver}/site-packages"
-EOF
-
 # Install macros
 install -Dpm 0644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.mingw32-python3
 install -Dpm 0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d/macros.mingw64-python3
@@ -347,22 +330,6 @@ cat > %{buildroot}%{_prefix}/%{mingw64_target}/bin/python3 <<EOF
 EOF
 chmod +x %{buildroot}%{_prefix}/%{mingw64_target}/bin/python3
 
-# TODO: These cause unsatisfyable requires on msvcr71.dll
-rm -f %{buildroot}%{mingw32_py3_libdir}/distutils/command/wininst-7.1.exe
-rm -f %{buildroot}%{mingw64_py3_libdir}/distutils/command/wininst-7.1.exe
-
-# Drop unversioned 2to3
-rm %{buildroot}%{mingw32_bindir}/2to3
-rm %{buildroot}%{mingw64_bindir}/2to3
-
-# Drop pip stuff installed to native dirs
-rm -f %{buildroot}%{_bindir}/pip*
-rm -rf %{buildroot}%{_prefix}/lib/python%{py_ver}/site-packages/pip*
-
-# Ensure config scripts are executable
-chmod +x %{buildroot}%{mingw32_bindir}/python3-config
-chmod +x %{buildroot}%{mingw64_bindir}/python3-config
-
 
 %files -n mingw32-%{pkgname}
 %license LICENSE
@@ -370,8 +337,6 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %{_rpmconfigdir}/macros.d/macros.mingw32-python3
 %{_rpmconfigdir}/fileattrs/mingw32_python3.attr
 %{_prefix}/%{mingw32_target}/bin/python3
-%{mingw32_py3_hostlibdir}/
-%{mingw32_bindir}/2to3-%{py_ver}
 %{mingw32_bindir}/idle3*
 %{mingw32_bindir}/pydoc3*
 %{mingw32_bindir}/python3.exe
@@ -379,14 +344,19 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %{mingw32_bindir}/python%{py_ver}.exe
 %{mingw32_bindir}/python%{py_ver}-config
 %{mingw32_bindir}/python3w.exe
+%{mingw32_bindir}/python%{py_ver}w.exe
+%{mingw32_bindir}/libpython3.dll
 %{mingw32_bindir}/libpython%{py_ver}.dll
 %{mingw32_py3_incdir}/
+%{mingw32_libdir}/libpython3.dll.a
 %{mingw32_libdir}/libpython%{py_ver}.dll.a
 %{mingw32_py3_libdir}/
 %{mingw32_libdir}/pkgconfig/*.pc
+# Part of mingw32-python3-test
+%exclude %{mingw32_py3_libdir}/test
 # Part of mingw32-python3-tkinter
 %exclude %{mingw32_py3_libdir}/tkinter/
-%exclude %{mingw32_py3_libdir}/lib-dynload/_tkinter.cpython-%{py_ver_nodots}.dll
+%exclude %{mingw32_py3_libdir}/lib-dynload/_tkinter.cp%{py_ver_nodots}-mingw_i686_msvcrt_gnu.pyd
 %exclude %{mingw32_py3_libdir}/turtle.py
 %exclude %{mingw32_py3_libdir}/__pycache__/turtle*
 %exclude %{mingw32_py3_libdir}/turtledemo
@@ -394,40 +364,13 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %exclude %{mingw32_bindir}/idle3
 %exclude %{mingw32_bindir}/idle%{py_ver}
 %exclude %{mingw32_py3_libdir}/idlelib/
-# Part of mingw32-python3-test
-%exclude %{mingw32_py3_libdir}/ctypes/test/
-%exclude %{mingw32_py3_libdir}/distutils/tests/
-%exclude %{mingw32_py3_libdir}/lib2to3/tests/
-%exclude %{mingw32_py3_libdir}/test/
-%exclude %{mingw32_py3_libdir}/tkinter/test/
-%exclude %{mingw32_py3_libdir}/unittest/test/
-%exclude %{mingw32_py3_libdir}/lib-dynload/_ctypes_test.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_testbuffer.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_testcapi.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_testimportmultiple.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_testinternalcapi.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_testmultiphase.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw32_py3_libdir}/lib-dynload/_xxtestfuzz.cpython-%{py_ver_nodots}.dll
 
 %files -n mingw32-%{pkgname}-test
-%{mingw32_py3_libdir}/ctypes/test/
-%{mingw32_py3_libdir}/distutils/tests/
-%{mingw32_py3_libdir}/lib2to3/tests/
-%{mingw32_py3_libdir}/test/
-%{mingw32_py3_libdir}/tkinter/test/
-%{mingw32_py3_libdir}/unittest/test/
-%{mingw32_py3_libdir}/lib-dynload/_ctypes_test.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_testbuffer.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_testcapi.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_testimportmultiple.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_testinternalcapi.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_testmultiphase.cpython-%{py_ver_nodots}.dll
-%{mingw32_py3_libdir}/lib-dynload/_xxtestfuzz.cpython-%{py_ver_nodots}.dll
+%{mingw32_py3_libdir}/test
 
 %files -n mingw32-%{pkgname}-tkinter
 %{mingw32_py3_libdir}/tkinter/
-%exclude %{mingw32_py3_libdir}/tkinter/test/
-%{mingw32_py3_libdir}/lib-dynload/_tkinter.cpython-%{py_ver_nodots}.dll
+%{mingw32_py3_libdir}/lib-dynload/_tkinter.cp%{py_ver_nodots}-mingw_i686_msvcrt_gnu.pyd
 %{mingw32_py3_libdir}/turtle.py
 %{mingw32_py3_libdir}/__pycache__/turtle*
 %{mingw32_py3_libdir}/turtledemo
@@ -443,8 +386,6 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %{_rpmconfigdir}/macros.d/macros.mingw64-python3
 %{_rpmconfigdir}/fileattrs/mingw64_python3.attr
 %{_prefix}/%{mingw64_target}/bin/python3
-%{mingw64_py3_hostlibdir}/
-%{mingw64_bindir}/2to3-%{py_ver}
 %{mingw64_bindir}/idle3*
 %{mingw64_bindir}/pydoc3*
 %{mingw64_bindir}/python3.exe
@@ -452,14 +393,19 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %{mingw64_bindir}/python%{py_ver}.exe
 %{mingw64_bindir}/python%{py_ver}-config
 %{mingw64_bindir}/python3w.exe
+%{mingw64_bindir}/python%{py_ver}w.exe
+%{mingw64_bindir}/libpython3.dll
 %{mingw64_bindir}/libpython%{py_ver}.dll
 %{mingw64_py3_incdir}/
+%{mingw64_libdir}/libpython3.dll.a
 %{mingw64_libdir}/libpython%{py_ver}.dll.a
 %{mingw64_py3_libdir}/
 %{mingw64_libdir}/pkgconfig/*.pc
+# Part of mingw64-python3-test
+%exclude %{mingw64_py3_libdir}/test
 # Part of mingw64-python3-tkinter
 %exclude %{mingw64_py3_libdir}/tkinter/
-%exclude %{mingw64_py3_libdir}/lib-dynload/_tkinter.cpython-%{py_ver_nodots}.dll
+%exclude %{mingw64_py3_libdir}/lib-dynload/_tkinter.cp%{py_ver_nodots}-mingw_x86_64_msvcrt_gnu.pyd
 %exclude %{mingw64_py3_libdir}/turtle.py
 %exclude %{mingw64_py3_libdir}/__pycache__/turtle*
 %exclude %{mingw64_py3_libdir}/turtledemo
@@ -467,40 +413,13 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 %exclude %{mingw64_bindir}/idle3
 %exclude %{mingw64_bindir}/idle%{py_ver}
 %exclude %{mingw64_py3_libdir}/idlelib/
-# Part of mingw64-python3-test
-%exclude %{mingw64_py3_libdir}/ctypes/test/
-%exclude %{mingw64_py3_libdir}/distutils/tests/
-%exclude %{mingw64_py3_libdir}/lib2to3/tests/
-%exclude %{mingw64_py3_libdir}/test/
-%exclude %{mingw64_py3_libdir}/tkinter/test/
-%exclude %{mingw64_py3_libdir}/unittest/test/
-%exclude %{mingw64_py3_libdir}/lib-dynload/_ctypes_test.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_testbuffer.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_testcapi.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_testimportmultiple.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_testinternalcapi.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_testmultiphase.cpython-%{py_ver_nodots}.dll
-%exclude %{mingw64_py3_libdir}/lib-dynload/_xxtestfuzz.cpython-%{py_ver_nodots}.dll
 
 %files -n mingw64-%{pkgname}-test
-%{mingw64_py3_libdir}/ctypes/test/
-%{mingw64_py3_libdir}/distutils/tests/
-%{mingw64_py3_libdir}/lib2to3/tests/
-%{mingw64_py3_libdir}/test/
-%{mingw64_py3_libdir}/tkinter/test/
-%{mingw64_py3_libdir}/unittest/test/
-%{mingw64_py3_libdir}/lib-dynload/_ctypes_test.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_testbuffer.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_testcapi.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_testimportmultiple.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_testinternalcapi.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_testmultiphase.cpython-%{py_ver_nodots}.dll
-%{mingw64_py3_libdir}/lib-dynload/_xxtestfuzz.cpython-%{py_ver_nodots}.dll
+%{mingw64_py3_libdir}/test
 
 %files -n mingw64-%{pkgname}-tkinter
 %{mingw64_py3_libdir}/tkinter/
-%exclude %{mingw64_py3_libdir}/tkinter/test/
-%{mingw64_py3_libdir}/lib-dynload/_tkinter.cpython-%{py_ver_nodots}.dll
+%{mingw64_py3_libdir}/lib-dynload/_tkinter.cp%{py_ver_nodots}-mingw_x86_64_msvcrt_gnu.pyd
 %{mingw64_py3_libdir}/turtle.py
 %{mingw64_py3_libdir}/__pycache__/turtle*
 %{mingw64_py3_libdir}/turtledemo
@@ -512,6 +431,12 @@ chmod +x %{buildroot}%{mingw64_bindir}/python3-config
 
 
 %changelog
+* Tue Sep 22 2026 Sandro Mani <manisandro@gmail.com> - 3.14.7-1
+- Update to 3.14.7
+
+* Tue Sep 22 2026 Sandro Mani <manisandro@gmail.com> - 3.14-1
+- Update to 3.14
+
 * Fri Sep 18 2026 Sandro Mani <manisandro@gmail.com> - 3.11.16-1
 - Update to 3.11.16
 

diff --git a/mingw-python3_distutils.patch b/mingw-python3_distutils.patch
deleted file mode 100644
index bde816c..0000000
--- a/mingw-python3_distutils.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Lib/distutils/ccompiler.py Python-3.11.16-new/Lib/distutils/ccompiler.py
---- Python-3.11.16/Lib/distutils/ccompiler.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/distutils/ccompiler.py	2026-09-18 19:23:07.402791820 +0200
-@@ -9,7 +9,7 @@ from distutils.spawn import spawn
- from distutils.file_util import move_file
- from distutils.dir_util import mkpath
- from distutils.dep_util import newer_group
--from distutils.util import split_quoted, execute
-+from distutils.util import split_quoted, execute, get_platform
- from distutils import log
- 
- class CCompiler:
-@@ -948,6 +948,8 @@ def get_default_compiler(osname=None, pl
-         osname = os.name
-     if platform is None:
-         platform = sys.platform
-+    if get_platform().startswith('mingw'):
-+        return 'mingw32'
-     for pattern, compiler in _default_compilers:
-         if re.match(pattern, platform) is not None or \
-            re.match(pattern, osname) is not None:
-@@ -1005,6 +1007,9 @@ def new_compiler(plat=None, compiler=Non
-         if compiler is None:
-             compiler = get_default_compiler(plat)
- 
-+        if "mingw32" in os.environ.get("CC", ""):
-+            compiler = "mingw32"
-+
-         (module_name, class_name, long_description) = compiler_class[compiler]
-     except KeyError:
-         msg = "don't know how to compile C/C++ code on platform '%s'" % plat
-diff -rupN --no-dereference Python-3.11.16/Lib/distutils/command/build_ext.py Python-3.11.16-new/Lib/distutils/command/build_ext.py
---- Python-3.11.16/Lib/distutils/command/build_ext.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/distutils/command/build_ext.py	2026-09-18 19:23:07.403189683 +0200
-@@ -186,7 +186,7 @@ class build_ext(Command):
-         # for extensions under windows use different directories
-         # for Release and Debug builds.
-         # also Python's library directory must be appended to library_dirs
--        if os.name == 'nt':
-+        if os.name == 'nt' and not self.plat_name.startswith(('mingw')):
-             # the 'libs' directory is for binary installs - we assume that
-             # must be the *native* platform.  But we don't really support
-             # cross-compiling via a binary install anyway, so we let it go.
-@@ -712,6 +712,20 @@ class build_ext(Command):
-         # pyconfig.h that MSVC groks.  The other Windows compilers all seem
-         # to need it mentioned explicitly, though, so that's what we do.
-         # Append '_d' to the python import library on debug builds.
-+
-+        # Use self.plat_name as it works even in case of
-+        # cross-compilation (at least for mingw build).
-+        if self.plat_name.startswith('mingw'):
-+            from distutils import sysconfig
-+            extra = []
-+            for lib in (
-+                sysconfig.get_config_var('BLDLIBRARY').split()
-+                + sysconfig.get_config_var('SHLIBS').split()
-+                ):
-+                if lib.startswith('-l'):
-+                    extra.append(lib[2:])
-+            return ext.libraries + extra
-+
-         if sys.platform == "win32":
-             from distutils._msvccompiler import MSVCCompiler
-             if not isinstance(self.compiler, MSVCCompiler):
-@@ -744,7 +758,7 @@ class build_ext(Command):
-                     # We are cross-compiling for one of the relevant platforms
-                     if get_config_var('ANDROID_API_LEVEL') != 0:
-                         link_libpython = True
--                    elif get_config_var('MACHDEP') == 'cygwin':
-+                    elif get_config_var('MACHDEP') == 'cygwin' or get_config_var('MACHDEP') == 'win32':
-                         link_libpython = True
- 
-             if link_libpython:
-diff -rupN --no-dereference Python-3.11.16/Lib/distutils/cygwinccompiler.py Python-3.11.16-new/Lib/distutils/cygwinccompiler.py
---- Python-3.11.16/Lib/distutils/cygwinccompiler.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/distutils/cygwinccompiler.py	2026-09-18 19:23:07.403495499 +0200
-@@ -90,7 +90,8 @@ class CygwinCCompiler(UnixCCompiler):
-     compiler_type = 'cygwin'
-     obj_extension = ".o"
-     static_lib_extension = ".a"
--    shared_lib_extension = ".dll"
-+    shared_lib_extension = ".dll.a"
-+    dylib_lib_extension = ".dll.a"
-     static_lib_format = "lib%s%s"
-     shared_lib_format = "%s%s"
-     exe_extension = ".exe"
-@@ -235,8 +236,9 @@ class CygwinCCompiler(UnixCCompiler):
-         # (On my machine: 10KiB < stripped_file < ??100KiB
-         #   unstripped_file = stripped_file + XXX KiB
-         #  ( XXX=254 for a typical python extension))
--        if not debug:
--            extra_preargs.append("-s")
-+        # => Let mingw-find-debuginfo.sh strip the binaries
-+        # if not debug:
-+        #     extra_preargs.append("-s")
- 
-         UnixCCompiler.link(self, target_desc, objects, output_filename,
-                            output_dir, libraries, library_dirs,
-@@ -313,7 +315,10 @@ class Mingw32CCompiler(CygwinCCompiler):
- 
-         # Include the appropriate MSVC runtime library if Python was built
-         # with MSVC 7.0 or later.
--        self.dll_libraries = get_msvcr()
-+        self.dll_libraries = get_msvcr() or []
-+
-+    def runtime_library_dir_option(self, dir):
-+        return "-L" + dir
- 
- # Because these compilers aren't configured in Python's pyconfig.h file by
- # default, we should at least warn the user if he is using an unmodified
-@@ -366,7 +371,7 @@ def check_config_h():
-         return (CONFIG_H_UNCERTAIN,
-                 "couldn't read '%s': %s" % (fn, exc.strerror))
- 
--RE_VERSION = re.compile(br'(\d+\.\d+(\.\d+)*)')
-+RE_VERSION = re.compile(br'[\D\s]*(\d+\.\d+(\.\d+)*).*$')
- 
- def _find_exe_version(cmd):
-     """Find the version of an executable by running `cmd` in the shell.
-@@ -394,10 +399,14 @@ def get_versions():
- 
-     If not possible it returns None for it.
-     """
--    commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
-+    gcc = os.environ.get('CC') or 'gcc'
-+    ld = os.environ.get('LD') or 'ld'
-+    dllwrap = os.environ.get('DLLWRAP') or 'dllwrap'
-+    commands = [gcc+' -dumpfullversion -dumpversion', ld+' -v', dllwrap+' --version']
-     return tuple([_find_exe_version(cmd) for cmd in commands])
- 
- def is_cygwingcc():
-     '''Try to determine if the gcc that would be used is from cygwin.'''
--    out_string = check_output(['gcc', '-dumpmachine'])
-+    gcc = os.environ.get('CC') or 'gcc'
-+    out_string = check_output([gcc, '-dumpmachine'])
-     return out_string.strip().endswith(b'cygwin')
-diff -rupN --no-dereference Python-3.11.16/Lib/distutils/sysconfig.py Python-3.11.16-new/Lib/distutils/sysconfig.py
---- Python-3.11.16/Lib/distutils/sysconfig.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/distutils/sysconfig.py	2026-09-18 19:23:07.403754788 +0200
-@@ -196,7 +196,7 @@ def customize_compiler(compiler):
-     Mainly needed on Unix, so we can plug in the information that
-     varies across Unices and is stored in Python's Makefile.
-     """
--    if compiler.compiler_type == "unix":
-+    if compiler.compiler_type in ["unix", "cygwin", "mingw32"]:
-         if sys.platform == "darwin":
-             # Perform first-time customization of compiler-related
-             # config vars on OS X now that we know we need a compiler.
-@@ -257,8 +257,8 @@ def customize_compiler(compiler):
-             linker_so=ldshared,
-             linker_exe=cc,
-             archiver=archiver)
--
--        compiler.shared_lib_extension = shlib_suffix
-+        # Don't override value but use what is set in derived compiler class itself
-+        # compiler.shared_lib_extension = shlib_suffix
- 
- 
- def get_python_inc(plat_specific=0, prefix=None):
-diff -rupN --no-dereference Python-3.11.16/Lib/distutils/util.py Python-3.11.16-new/Lib/distutils/util.py
---- Python-3.11.16/Lib/distutils/util.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/distutils/util.py	2026-09-18 19:23:07.403995140 +0200
-@@ -37,6 +37,8 @@ def get_host_platform():
- 
-     """
-     if os.name == 'nt':
-+        if 'GCC' in sys.version:
-+            return 'mingw'
-         if 'amd64' in sys.version.lower():
-             return 'win-amd64'
-         if '(arm)' in sys.version.lower():

diff --git a/mingw-python3_frozenmain.patch b/mingw-python3_frozenmain.patch
deleted file mode 100644
index 3a2d505..0000000
--- a/mingw-python3_frozenmain.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/configure.ac Python-3.11.16-new/configure.ac
---- Python-3.11.16/configure.ac	2026-09-18 19:23:06.024979888 +0200
-+++ Python-3.11.16-new/configure.ac	2026-09-18 19:23:06.313392165 +0200
-@@ -6411,6 +6411,16 @@ do
-   THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
- done
- 
-+dnl Python interpreter main program for frozen scripts
-+AC_SUBST(PYTHON_OBJS_FROZENMAIN)
-+PYTHON_OBJS_FROZENMAIN="Python/frozenmain.o"
-+case $host in
-+  *-*-mingw*)
-+    dnl 'PC/frozen_dllmain.c' - not yet
-+    PYTHON_OBJS_FROZENMAIN=
-+    ;;
-+esac
-+
- AC_SUBST(SRCDIRS)
- SRCDIRS="\
-   Modules \
-diff -rupN --no-dereference Python-3.11.16/Makefile.pre.in Python-3.11.16-new/Makefile.pre.in
---- Python-3.11.16/Makefile.pre.in	2026-09-18 19:23:06.027882195 +0200
-+++ Python-3.11.16-new/Makefile.pre.in	2026-09-18 19:23:06.313963638 +0200
-@@ -390,7 +390,7 @@ PYTHON_OBJS=	\
- 		Python/dynamic_annotations.o \
- 		Python/errors.o \
- 		Python/frame.o \
--		Python/frozenmain.o \
-+		@PYTHON_OBJS_FROZENMAIN@ \
- 		Python/future.o \
- 		Python/getargs.o \
- 		Python/getcompiler.o \

diff --git a/mingw-python3_make-sysconfigdata.py-relocatable.patch b/mingw-python3_make-sysconfigdata.py-relocatable.patch
deleted file mode 100644
index e41cf88..0000000
--- a/mingw-python3_make-sysconfigdata.py-relocatable.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Lib/sysconfig.py Python-3.11.16-new/Lib/sysconfig.py
---- Python-3.11.16/Lib/sysconfig.py	2026-09-18 19:23:06.027339246 +0200
-+++ Python-3.11.16-new/Lib/sysconfig.py	2026-09-18 19:23:07.662043432 +0200
-@@ -2,6 +2,7 @@
- 
- import os
- import sys
-+import textwrap
- from os.path import pardir, realpath
- 
- __all__ = [
-@@ -514,11 +515,29 @@ def _generate_posix_vars():
-     os.makedirs(pybuilddir, exist_ok=True)
-     destfile = os.path.join(pybuilddir, name + '.py')
- 
-+    replacement = """
-+        keys_to_replace = [
-+            'BINDIR', 'BINLIBDEST', 'CONFINCLUDEDIR',
-+            'CONFINCLUDEPY', 'DESTDIRS', 'DESTLIB', 'DESTSHARED',
-+            'INCLDIRSTOMAKE', 'INCLUDEDIR', 'INCLUDEPY',
-+            'LIBDEST', 'LIBDIR', 'LIBPC', 'LIBPL', 'MACHDESTLIB',
-+            'MANDIR', 'SCRIPTDIR', 'datarootdir', 'exec_prefix',
-+        ]
-+
-+        prefix = build_time_vars['BINDIR'][:-4]
-+
-+        for key in keys_to_replace:
-+            value = build_time_vars[key]
-+            build_time_vars[key] = value.replace(prefix, sys.prefix)
-+    """
-+
-     with open(destfile, 'w', encoding='utf8') as f:
-+        f.write('import sys\n')
-         f.write('# system configuration generated and used by'
-                 ' the sysconfig module\n')
-         f.write('build_time_vars = ')
-         pprint.pprint(vars, stream=f)
-+        f.write('\n%s' % textwrap.dedent(replacement))
- 
-     # Create file used for sys.path fixup -- see Modules/getpath.c
-     with open('pybuilddir.txt', 'w', encoding='utf8') as f:

diff --git a/mingw-python3_mods-failed.patch b/mingw-python3_mods-failed.patch
deleted file mode 100644
index 98dd7f2..0000000
--- a/mingw-python3_mods-failed.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/setup.py Python-3.11.16-new/setup.py
---- Python-3.11.16/setup.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/setup.py	2026-09-18 19:23:07.149346892 +0200
-@@ -577,6 +577,8 @@ class PyBuildExt(build_ext):
-             print("Failed to build these modules:")
-             print_three_column(failed)
-             print()
-+            with open('mods_failed.txt', 'w') as fh:
-+                fh.write(", ".join(failed) + "\n")
- 
-         if self.failed_on_import:
-             failed = self.failed_on_import[:]

diff --git a/mingw-python3_module-select.patch b/mingw-python3_module-select.patch
deleted file mode 100644
index 8055ce6..0000000
--- a/mingw-python3_module-select.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Modules/selectmodule.c Python-3.11.16-new/Modules/selectmodule.c
---- Python-3.11.16/Modules/selectmodule.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/selectmodule.c	2026-09-18 19:23:08.972073826 +0200
-@@ -146,9 +146,9 @@ seq2set(PyObject *seq, fd_set *set, pyli
-         v = PyObject_AsFileDescriptor( o );
-         if (v == -1) goto finally;
- 
--#if defined(_MSC_VER)
-+#if defined(MS_WINDOWS)
-         max = 0;                             /* not used for Win32 */
--#else  /* !_MSC_VER */
-+#else  /* MS_WINDOWS */
-         if (!_PyIsSelectable_fd(v)) {
-             PyErr_SetString(PyExc_ValueError,
-                         "filedescriptor out of range in select()");
-@@ -156,7 +156,7 @@ seq2set(PyObject *seq, fd_set *set, pyli
-         }
-         if (v > max)
-             max = v;
--#endif /* _MSC_VER */
-+#endif /* MS_WINDOWS */
-         FD_SET(v, set);
- 
-         /* add object and its file descriptor to the list */

diff --git a/mingw-python3_module-socket.patch b/mingw-python3_module-socket.patch
deleted file mode 100644
index e7b706c..0000000
--- a/mingw-python3_module-socket.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/configure.ac Python-3.11.16-new/configure.ac
---- Python-3.11.16/configure.ac	2026-09-18 19:23:06.604947276 +0200
-+++ Python-3.11.16-new/configure.ac	2026-09-18 19:23:08.711828946 +0200
-@@ -4646,8 +4646,8 @@ AC_CHECK_FUNCS([ \
-   faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
-   fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
-   gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
--  getgrnam_r getgrouplist getgroups gethostname getitimer getloadavg getlogin \
--  getpeername getpgid getpid getppid getpriority _getpty \
-+  getgrnam_r getgrouplist getgroups getitimer getloadavg getlogin \
-+  getpgid getpid getppid getpriority _getpty \
-   getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid getspent \
-   getspnam getuid getwd if_nameindex initgroups kill killpg lchown linkat \
-   lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
-@@ -4889,7 +4889,13 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma],
- ])
- 
- dnl PY_CHECK_NETDB_FUNC(FUNCTION)
--AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [#include <netdb.h>])])
-+AC_DEFUN([PY_CHECK_NETDB_FUNC], [PY_CHECK_FUNC([$1], [
-+#ifdef _WIN32
-+#  include <winsock2.h>
-+#else
-+#  include <netdb.h>
-+#endif
-+])])
- 
- PY_CHECK_NETDB_FUNC([hstrerror])
- dnl not available in WASI yet
-@@ -4898,13 +4904,18 @@ PY_CHECK_NETDB_FUNC([getservbyport])
- PY_CHECK_NETDB_FUNC([gethostbyname])
- PY_CHECK_NETDB_FUNC([gethostbyaddr])
- PY_CHECK_NETDB_FUNC([getprotobyname])
-+PY_CHECK_NETDB_FUNC([gethostname])
- 
- dnl PY_CHECK_SOCKET_FUNC(FUNCTION)
- AC_DEFUN([PY_CHECK_SOCKET_FUNC], [PY_CHECK_FUNC([$1], [
- #include <sys/types.h>
--#include <sys/socket.h>
--#include <netinet/in.h>
--#include <arpa/inet.h>
-+#ifdef _WIN32
-+#  include <winsock2.h>
-+#else
-+#  include <sys/socket.h>
-+#  include <netinet/in.h>
-+#  include <arpa/inet.h>
-+#endif
- ])])
- 
- PY_CHECK_SOCKET_FUNC([inet_aton])
-diff -rupN --no-dereference Python-3.11.16/Modules/Setup Python-3.11.16-new/Modules/Setup
---- Python-3.11.16/Modules/Setup	2026-09-18 19:23:08.707327744 +0200
-+++ Python-3.11.16-new/Modules/Setup	2026-09-18 19:23:08.713488385 +0200
-@@ -144,7 +144,7 @@ PYTHONPATH=$(COREPYTHONPATH)
- #_pickle _pickle.c
- #_queue _queuemodule.c
- #_random _randommodule.c
--#_socket socketmodule.c
-+_socket socketmodule.c -lws2_32 -liphlpapi
- #_statistics _statisticsmodule.c
- #_struct _struct.c
- #_typing _typingmodule.c
-diff -rupN --no-dereference Python-3.11.16/Modules/socketmodule.c Python-3.11.16-new/Modules/socketmodule.c
---- Python-3.11.16/Modules/socketmodule.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/socketmodule.c	2026-09-18 19:23:08.714180901 +0200
-@@ -274,7 +274,7 @@ shutdown(how) -- shut down traffic in on
- # endif
- 
- /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */
--#ifdef MS_WINDOWS
-+#ifdef _MSC_VER
- #define IPPROTO_ICMP IPPROTO_ICMP
- #define IPPROTO_IGMP IPPROTO_IGMP
- #define IPPROTO_GGP IPPROTO_GGP
-@@ -404,6 +404,10 @@ remove_unusable_flags(PyObject *m)
-   /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
-    * EAI_* constants are defined in (the already included) ws2tcpip.h.
-    */
-+#elif defined(__MINGW32__)
-+  /* Do not include addrinfo.h as minimum supported version is
-+   * _WIN32_WINNT >= WindowsXP(0x0501)
-+   */
- #else
- #  include "addrinfo.h"
- #endif
-@@ -8112,7 +8116,7 @@ PyInit__socket(void)
-     PyModule_AddIntMacro(m, IPPROTO_MAX);
- #endif
- 
--#ifdef  MS_WINDOWS
-+#ifdef  _MSC_VER
-     PyModule_AddIntMacro(m, IPPROTO_ICLFXBM);
-     PyModule_AddIntMacro(m, IPPROTO_ST);
-     PyModule_AddIntMacro(m, IPPROTO_CBT);

diff --git a/mingw-python3_modules.patch b/mingw-python3_modules.patch
deleted file mode 100644
index d5204d2..0000000
--- a/mingw-python3_modules.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Makefile.pre.in Python-3.11.16-new/Makefile.pre.in
---- Python-3.11.16/Makefile.pre.in	2026-09-18 19:23:06.890144870 +0200
-+++ Python-3.11.16-new/Makefile.pre.in	2026-09-18 19:23:07.941849004 +0200
-@@ -761,7 +761,7 @@ $(srcdir)/Modules/_blake2/blake2s_impl.c
- # -s, --silent or --quiet is always the first char.
- # Under BSD make, MAKEFLAGS might be " -s -v x=y".
- # Ignore macros passed by GNU make, passed after --
--sharedmods: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL@
-+sharedmods: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL@ $(BUILDPYTHON)
- 	@case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
- 	    *\ -s*|s*) quiet="-q";; \
- 	    *) quiet="";; \
-diff -rupN --no-dereference Python-3.11.16/Modules/_ctypes/_ctypes.c Python-3.11.16-new/Modules/_ctypes/_ctypes.c
---- Python-3.11.16/Modules/_ctypes/_ctypes.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/_ctypes/_ctypes.c	2026-09-18 19:23:07.942688687 +0200
-@@ -109,6 +109,7 @@ bytes(cdata)
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- #  include <windows.h>
-+#  include <dlfcn.h>
- #endif
- 
- #include "pycore_call.h"          // _PyObject_CallNoArgs()
-diff -rupN --no-dereference Python-3.11.16/Modules/_multiprocessing/semaphore.c Python-3.11.16-new/Modules/_multiprocessing/semaphore.c
---- Python-3.11.16/Modules/_multiprocessing/semaphore.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/_multiprocessing/semaphore.c	2026-09-18 19:23:07.943395929 +0200
-@@ -8,6 +8,9 @@
-  */
- 
- #include "multiprocessing.h"
-+#ifdef __MINGW32__
-+#include <semaphore.h>
-+#endif
- 
- #ifdef HAVE_MP_SEMAPHORE
- 
-diff -rupN --no-dereference Python-3.11.16/Modules/Setup Python-3.11.16-new/Modules/Setup
---- Python-3.11.16/Modules/Setup	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/Setup	2026-09-18 19:23:07.943700091 +0200
-@@ -154,7 +154,7 @@ PYTHONPATH=$(COREPYTHONPATH)
- #binascii binascii.c
- #cmath cmathmodule.c
- #math mathmodule.c
--#mmap mmapmodule.c
-+mmap mmapmodule.c
- #select selectmodule.c
- 
- # XML
-diff -rupN --no-dereference Python-3.11.16/setup.py Python-3.11.16-new/setup.py
---- Python-3.11.16/setup.py	2026-09-18 19:23:07.399039714 +0200
-+++ Python-3.11.16-new/setup.py	2026-09-18 19:23:07.943995754 +0200
-@@ -977,7 +977,10 @@ class PyBuildExt(build_ext):
-         self.addext(Extension('spwd', ['spwdmodule.c']))
- 
-         # select(2); not on ancient System V
--        self.addext(Extension('select', ['selectmodule.c']))
-+        select_libs = []
-+        if HOST_PLATFORM.startswith(('mingw', 'win')):
-+            select_libs += ['ws2_32']
-+        self.addext(Extension('select', ['selectmodule.c'], libraries=select_libs))
- 
-         # Memory-mapped files (also works on Win32).
-         self.addext(Extension('mmap', ['mmapmodule.c']))
-@@ -1009,7 +1012,8 @@ class PyBuildExt(build_ext):
-         self.addext(Extension('_csv', ['_csv.c']))
- 
-         # POSIX subprocess module helper.
--        self.addext(Extension('_posixsubprocess', ['_posixsubprocess.c']))
-+        # FIXME Force disabled
-+        # self.addext(Extension('_posixsubprocess', ['_posixsubprocess.c']))
- 
-     def detect_test_extensions(self):
-         # Python C API test module
-@@ -1104,6 +1108,8 @@ class PyBuildExt(build_ext):
-                 # readline package
-                 if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
-                     do_readline = False
-+        # FIXME Force disabled
-+        do_readline = False
-         if do_readline:
-             readline_libs = [readline_lib]
-             if readline_termcap_library:
-@@ -1328,13 +1334,16 @@ class PyBuildExt(build_ext):
- 
-     def detect_multiprocessing(self):
-         # Richard Oudkerk's multiprocessing module
-+        multiproc_libs = []
-         multiprocessing_srcs = ['_multiprocessing/multiprocessing.c']
-         if (
-             sysconfig.get_config_var('HAVE_SEM_OPEN') and not
-             sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')
-         ):
-             multiprocessing_srcs.append('_multiprocessing/semaphore.c')
--        self.addext(Extension('_multiprocessing', multiprocessing_srcs))
-+        if HOST_PLATFORM.startswith(('mingw', 'win')):
-+            multiproc_libs += ['ws2_32']
-+        self.addext(Extension('_multiprocessing', multiprocessing_srcs, libraries=multiproc_libs))
-         self.addext(Extension('_posixshmem', ['_multiprocessing/posixshmem.c']))
- 
-     def detect_uuid(self):
-@@ -1374,7 +1383,8 @@ class PyBuildExt(build_ext):
-         self.addext(Extension('xxlimited_35', ['xxlimited_35.c']))
- 
-     def detect_tkinter(self):
--        self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c']))
-+        tkinter_libs = ['tcl', 'tk']
-+        self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], libraries=tkinter_libs))
- 
-     def configure_ctypes(self, ext):
-         return True
-@@ -1421,7 +1431,7 @@ class PyBuildExt(build_ext):
-                         sources=sources)
-         self.add(ext)
-         # function my_sqrt() needs libm for sqrt()
--        self.addext(Extension('_ctypes_test', ['_ctypes/_ctypes_test.c']))
-+        self.addext(Extension('_ctypes_test', sources=['_ctypes/_ctypes_test.c'], libraries=['oleaut32']))
- 
-         ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
-         ffi_lib = None
-@@ -1472,6 +1482,10 @@ class PyBuildExt(build_ext):
-             # for dlopen, see bpo-32647
-             ext.libraries.append('dl')
- 
-+        ext.libraries.append('ole32')
-+        ext.libraries.append('oleaut32')
-+        ext.libraries.append('uuid')
-+
-     def detect_decimal(self):
-         # Stefan Krah's _decimal module
-         self.addext(
-@@ -1484,7 +1498,10 @@ class PyBuildExt(build_ext):
-         )
- 
-     def detect_openssl_hashlib(self):
--        self.addext(Extension('_ssl', ['_ssl.c']))
-+        openssl_libs= []
-+        if HOST_PLATFORM.startswith(('mingw', 'win')):
-+            openssl_libs += ['ws2_32']
-+        self.addext(Extension('_ssl', ['_ssl.c'], libraries=openssl_libs))
-         self.addext(Extension('_hashlib', ['_hashopenssl.c']))
- 
-     def detect_hash_builtins(self):

diff --git a/mingw-python3_pkgconfig.patch b/mingw-python3_pkgconfig.patch
deleted file mode 100644
index 386d5d8..0000000
--- a/mingw-python3_pkgconfig.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Misc/python.pc.in Python-3.11.16-new/Misc/python.pc.in
---- Python-3.11.16/Misc/python.pc.in	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Misc/python.pc.in	2026-09-18 19:23:09.231255000 +0200
-@@ -9,5 +9,5 @@ Description: Build a C extension for Pyt
- Requires:
- Version: @VERSION@
- Libs.private: @LIBS@
--Libs:
-+Libs: -lpython@VERSION@@ABIFLAGS@
- Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@

diff --git a/mingw-python3_platform-mingw.patch b/mingw-python3_platform-mingw.patch
deleted file mode 100644
index 74d9e23..0000000
--- a/mingw-python3_platform-mingw.patch
+++ /dev/null
@@ -1,303 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/config.site-mingw Python-3.11.16-new/config.site-mingw
---- Python-3.11.16/config.site-mingw	1970-01-01 01:00:00.000000000 +0100
-+++ Python-3.11.16-new/config.site-mingw	2026-09-18 19:23:05.744813901 +0200
-@@ -0,0 +1,2 @@
-+ac_cv_file__dev_ptmx=no
-+ac_cv_file__dev_ptc=no
-diff -rupN --no-dereference Python-3.11.16/configure.ac Python-3.11.16-new/configure.ac
---- Python-3.11.16/configure.ac	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/configure.ac	2026-09-18 19:23:05.745344198 +0200
-@@ -528,6 +528,15 @@ AC_DEFINE_UNQUOTED(_PYTHONFRAMEWORK, "${
- # Set name for machine-dependent library files
- AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
- AC_MSG_CHECKING(MACHDEP)
-+case $host in
-+  *-*-mingw*)
-+    test -z "$MACHDEP" && MACHDEP=win32
-+
-+    dnl Configuration will be based only on "host triplet" as build
-+    dnl must not depend from posix compatible environement.
-+    ac_sys_system=ignore
-+    ;;
-+esac
- if test -z "$MACHDEP"
- then
-     # avoid using uname for cross builds
-@@ -554,6 +563,8 @@ then
- 	*-*-wasi)
- 	    ac_sys_system=WASI
- 	    ;;
-+        *-*-mingw*)
-+            ;;
- 	*)
- 		# for now, limit cross builds to known configurations
- 		MACHDEP="unknown"
-@@ -614,12 +625,23 @@ if test "$cross_compiling" = yes; then
- 	wasm32-*-* | wasm64-*-*)
- 		_host_cpu=$host_cpu
- 		;;
-+	*-*-mingw*)
-+		_host_cpu=
-+		;;
- 	*)
- 		# for now, limit cross builds to known configurations
- 		MACHDEP="unknown"
- 		AC_MSG_ERROR([cross build not supported for $host])
- 	esac
- 	_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
-+
-+	case "$host_os" in
-+	mingw*)
-+	# As sys.platform() return 'win32' to build python and extantions
-+	# we will use 'mingw' (in setup.py and etc.)
-+	_PYTHON_HOST_PLATFORM=mingw
-+	;;
-+	esac
- fi
- 
- # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
-@@ -1526,6 +1548,13 @@ if test $enable_shared = "yes"; then
- 	;;
- 
-   esac
-+  case $host in
-+    *-*-mingw*)
-+        LDLIBRARY='libpython$(LDVERSION).dll.a'
-+        DLLLIBRARY='libpython$(LDVERSION).dll'
-+        BLDLIBRARY='-L. -lpython$(LDVERSION)'
-+        ;;
-+  esac
- else # shared is disabled
-   PY_ENABLE_SHARED=0
-   case $ac_sys_system in
-@@ -1534,6 +1563,10 @@ else # shared is disabled
-           LDLIBRARY='libpython$(LDVERSION).dll.a'
-           ;;
-   esac
-+  case $host in
-+    *-*-mingw*)
-+          LDLIBRARY='libpython$(LDVERSION).a';;
-+  esac
- fi
- 
- if test "$cross_compiling" = yes; then
-@@ -3101,6 +3134,9 @@ if test -z "$SHLIB_SUFFIX"; then
- 	CYGWIN*)   SHLIB_SUFFIX=.dll;;
- 	*)	   SHLIB_SUFFIX=.so;;
- 	esac
-+	case $host_os in
-+	mingw*)    SHLIB_SUFFIX=.dll;;
-+	esac
- fi
- AC_MSG_RESULT($SHLIB_SUFFIX)
- 
-@@ -3232,6 +3268,12 @@ then
- 		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
- 	*)	LDSHARED="ld";;
- 	esac
-+	case $host in
-+	*-*-mingw*)
-+		LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base'
-+		LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base'
-+		;;
-+	esac
- fi
- 
- dnl Emscripten's emconfigure sets LDSHARED. Set BLDSHARED outside the
-@@ -4567,6 +4609,12 @@ then
- 	fi
- 	;;
- 	esac
-+	case $host in
-+	*-*-mingw*)
-+	DYNLOADFILE="dynload_win.o"
-+	extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o"
-+	;;
-+	esac
- fi
- AC_MSG_RESULT($DYNLOADFILE)
- if test "$DYNLOADFILE" != "dynload_stub.o"
-@@ -4593,7 +4641,7 @@ fi
- 
- # checks for library functions
- AC_CHECK_FUNCS([ \
--  accept4 alarm bind_textdomain_codeset chmod chown clock close_range confstr \
-+  accept4 bind_textdomain_codeset chmod chown clock close_range confstr \
-   copy_file_range ctermid dup dup3 execv explicit_bzero explicit_memset \
-   faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
-   fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
-@@ -5717,7 +5765,7 @@ AC_MSG_RESULT($LDVERSION)
- 
- # On Android and Cygwin the shared libraries must be linked with libpython.
- AC_SUBST(LIBPYTHON)
--if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
-+if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "win32"; then
-   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
- else
-   LIBPYTHON=''
-@@ -6277,6 +6325,9 @@ AC_CHECK_TYPE(socklen_t,,
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif
-+#ifdef __MINGW32__
-+#include <ws2tcpip.h>
-+#endif
- ])
- 
- AC_CACHE_CHECK([for broken mbstowcs], [ac_cv_broken_mbstowcs],
-@@ -6750,6 +6801,19 @@ WITH_SAVE_ENV([
-   ])
- ])
- 
-+# For mingw build need additional library for linking
-+case $host in
-+  *-*-mingw*)
-+    LIBS="$LIBS -lversion -lshlwapi -lpathcch -lbcrypt"
-+    CFLAGS="$CFLAGS -DMS_WINDOWS -DMS_WIN32"
-+  ;&
-+  x86_64-*-mingw*)
-+    CFLAGS="$CFLAGS -DMS_WIN64";
-+  ;;
-+  *)
-+  ;;
-+esac
-+
- # ssl module default cipher suite string
- AH_TEMPLATE(PY_SSL_DEFAULT_CIPHERS,
-   [Default cipher suites list for ssl module.
-diff -rupN --no-dereference Python-3.11.16/Include/pyport.h Python-3.11.16-new/Include/pyport.h
---- Python-3.11.16/Include/pyport.h	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Include/pyport.h	2026-09-18 19:23:05.746311934 +0200
-@@ -347,7 +347,8 @@ extern "C" {
-     _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
- #define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
- #elif defined(__GNUC__) \
--    && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
-+    && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) \
-+    && !defined(__MINGW32__)
- #define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
- #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
-     _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-diff -rupN --no-dereference Python-3.11.16/Lib/sysconfig.py Python-3.11.16-new/Lib/sysconfig.py
---- Python-3.11.16/Lib/sysconfig.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/sysconfig.py	2026-09-18 19:23:05.746699688 +0200
-@@ -737,6 +737,8 @@ def get_platform():
- 
-     """
-     if os.name == 'nt':
-+        if 'GCC' in sys.version:
-+            return 'mingw'
-         if 'amd64' in sys.version.lower():
-             return 'win-amd64'
-         if '(arm)' in sys.version.lower():
-diff -rupN --no-dereference Python-3.11.16/Makefile.pre.in Python-3.11.16-new/Makefile.pre.in
---- Python-3.11.16/Makefile.pre.in	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Makefile.pre.in	2026-09-18 19:23:05.747124274 +0200
-@@ -118,7 +118,7 @@ CFLAGSFORSHARED=@CFLAGSFORSHARED@
- # C flags used for building the interpreter object files
- PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
- PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
--PY_CORE_CFLAGS=	$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
-+PY_CORE_CFLAGS=	$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE -DMS_WINDOWS -DMS_COREDLL -DMS_DLL_ID=\"@VERSION@\" -DPY3_DLLNAME=\"@DLLLIBRARY@\"
- # Linker flags used for building the interpreter object files
- PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
- # Strict or non-strict aliasing flags used to compile dtoa.c, see above
-diff -rupN --no-dereference Python-3.11.16/Modules/posixmodule.c Python-3.11.16-new/Modules/posixmodule.c
---- Python-3.11.16/Modules/posixmodule.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/posixmodule.c	2026-09-18 19:23:05.748264616 +0200
-@@ -343,7 +343,7 @@ corresponding Unix manual entries for mo
- #  define HAVE_SYSTEM     1
- #  include <process.h>
- #else
--#  ifdef _MSC_VER
-+#  ifdef MS_WINDOWS
-      /* Microsoft compiler */
- #    define HAVE_GETPPID    1
- #    define HAVE_GETLOGIN   1
-@@ -356,7 +356,7 @@ corresponding Unix manual entries for mo
- #    define HAVE_CWAIT      1
- #    define HAVE_FSYNC      1
- #    define fsync _commit
--#  endif  /* _MSC_VER */
-+#  endif  /* MS_WINDOWS */
- #endif  /* ! __WATCOMC__ || __QNX__ */
- 
- /*[clinic input]
-@@ -434,7 +434,7 @@ extern char        *ctermid_r(char *);
- #  endif
- #endif
- 
--#ifdef _MSC_VER
-+#ifdef MS_WINDOWS
- #  ifdef HAVE_DIRECT_H
- #    include <direct.h>
- #  endif
-@@ -4057,7 +4057,7 @@ os_link_impl(PyObject *module, path_t *s
- #endif
- 
- 
--#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
-+#if defined(MS_WINDOWS)
- static PyObject *
- _listdir_windows_no_opendir(path_t *path, PyObject *list)
- {
-@@ -4298,7 +4298,7 @@ os_listdir_impl(PyObject *module, path_t
-                     path->object ? path->object : Py_None) < 0) {
-         return NULL;
-     }
--#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
-+#if defined(MS_WINDOWS)
-     return _listdir_windows_no_opendir(path, NULL);
- #else
-     return _posix_listdir(path, NULL);
-diff -rupN --no-dereference Python-3.11.16/Objects/exceptions.c Python-3.11.16-new/Objects/exceptions.c
---- Python-3.11.16/Objects/exceptions.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Objects/exceptions.c	2026-09-18 19:23:05.749862570 +0200
-@@ -1648,7 +1648,9 @@ MiddlingExtendsException(PyExc_ImportErr
-  */
- 
- #ifdef MS_WINDOWS
--#include "errmap.h"
-+#include <winsock2.h>
-+#include <windows.h>
-+#include "../PC/errmap.h"
- #endif
- 
- /* Where a function has a single filename, such as open() or some
-diff -rupN --no-dereference Python-3.11.16/Python/dynload_win.c Python-3.11.16-new/Python/dynload_win.c
---- Python-3.11.16/Python/dynload_win.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Python/dynload_win.c	2026-09-18 19:23:05.750484571 +0200
-@@ -21,9 +21,9 @@
- #endif
- 
- #ifdef PYD_PLATFORM_TAG
--#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".pyd"
-+#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cpython-" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".dll"
- #else
--#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) ".pyd"
-+#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cpython-" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) ".dll"
- #endif
- 
- #define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd"
-@@ -170,7 +170,7 @@ static char *GetPythonImport (HINSTANCE
-    Return whether the DLL was found.
- */
- extern HMODULE PyWin_DLLhModule;
--static int
-+int
- _Py_CheckPython3(void)
- {
-     static int python3_checked = 0;
-diff -rupN --no-dereference Python-3.11.16/Python/sysmodule.c Python-3.11.16-new/Python/sysmodule.c
---- Python-3.11.16/Python/sysmodule.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Python/sysmodule.c	2026-09-18 19:23:05.750871477 +0200
-@@ -2982,7 +2982,8 @@ _PySys_InitCore(PyThreadState *tstate, P
-             goto type_init_failed;
-         }
-     }
--
-+// FIXME ???? What is VPATH?
-+#define VPATH "..\\.."
-     SET_SYS_FROM_STRING("_vpath", VPATH);
- #endif
- 

diff --git a/mingw-python3_posix-layout.patch b/mingw-python3_posix-layout.patch
deleted file mode 100644
index c8a7592..0000000
--- a/mingw-python3_posix-layout.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Lib/site.py Python-3.11.16-new/Lib/site.py
---- Python-3.11.16/Lib/site.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Lib/site.py	2026-09-18 19:23:08.207027150 +0200
-@@ -371,7 +371,7 @@ def getsitepackages(prefixes=None):
-             continue
-         seen.add(prefix)
- 
--        if os.sep == '/':
-+        if True: #os.sep == '/':
-             libdirs = [sys.platlibdir]
-             if sys.platlibdir != "lib":
-                 libdirs.append("lib")
-diff -rupN --no-dereference Python-3.11.16/Lib/sysconfig.py Python-3.11.16-new/Lib/sysconfig.py
---- Python-3.11.16/Lib/sysconfig.py	2026-09-18 19:23:07.937613448 +0200
-+++ Python-3.11.16-new/Lib/sysconfig.py	2026-09-18 19:23:08.207525622 +0200
-@@ -48,13 +48,13 @@ _INSTALL_SCHEMES = {
-         'data': '{base}',
-         },
-     'nt': {
--        'stdlib': '{installed_base}/Lib',
--        'platstdlib': '{base}/Lib',
--        'purelib': '{base}/Lib/site-packages',
--        'platlib': '{base}/Lib/site-packages',
--        'include': '{installed_base}/Include',
--        'platinclude': '{installed_base}/Include',
--        'scripts': '{base}/Scripts',
-+        'stdlib': '{installed_base}/lib/python{py_version_short}',
-+        'platstdlib': '{base}/lib/python{py_version_short}',
-+        'purelib': '{base}/lib/python{py_version_short}/site-packages',
-+        'platlib': '{base}/lib/python{py_version_short}/site-packages',
-+        'include': '{installed_base}/include/python{py_version_short}',
-+        'platinclude': '{installed_base}/include/python{py_version_short}',
-+        'scripts': '{base}/bin',
-         'data': '{base}',
-         },
-     # Downstream distributors can overwrite the default install scheme.
-@@ -135,12 +135,12 @@ if _HAS_USER_BASE:
-     _INSTALL_SCHEMES |= {
-         # NOTE: When modifying "purelib" scheme, update site._get_path() too.
-         'nt_user': {
--            'stdlib': '{userbase}/Python{py_version_nodot_plat}',
--            'platstdlib': '{userbase}/Python{py_version_nodot_plat}',
--            'purelib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
--            'platlib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
--            'include': '{userbase}/Python{py_version_nodot_plat}/Include',
--            'scripts': '{userbase}/Python{py_version_nodot_plat}/Scripts',
-+            'stdlib': '{userbase}/lib/python{py_version_short}',
-+            'platstdlib': '{userbase}/lib/python{py_version_short}',
-+            'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
-+            'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
-+            'include': '{userbase}/include/python{py_version_short}',
-+            'scripts': '{userbase}/bin',
-             'data': '{userbase}',
-             },
-         'posix_user': {
-@@ -560,7 +560,7 @@ def _init_non_posix(vars):
-     vars['INCLUDEPY'] = get_path('include')
-     vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0]
-     vars['EXE'] = '.exe'
--    vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
-+    vars['VERSION'] = _PY_VERSION_SHORT
-     vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
-     vars['TZPATH'] = ''
- 
-diff -rupN --no-dereference Python-3.11.16/Modules/getpath.c Python-3.11.16-new/Modules/getpath.c
---- Python-3.11.16/Modules/getpath.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/getpath.c	2026-09-18 19:23:08.207860759 +0200
-@@ -883,7 +883,11 @@ _PyConfig_InitPathConfig(PyConfig *confi
- 
-     if (
- #ifdef MS_WINDOWS
-+# ifdef __MINGW32__
-+        !decode_to_dict(dict, "os_name", "mingw") ||
-+# else
-         !decode_to_dict(dict, "os_name", "nt") ||
-+# endif
- #elif defined(__APPLE__)
-         !decode_to_dict(dict, "os_name", "darwin") ||
- #else
-diff -rupN --no-dereference Python-3.11.16/Modules/getpath.py Python-3.11.16-new/Modules/getpath.py
---- Python-3.11.16/Modules/getpath.py	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/getpath.py	2026-09-18 19:23:08.208149326 +0200
-@@ -184,6 +184,19 @@ if os_name == 'posix' or os_name == 'dar
-     DELIM = ':'
-     SEP = '/'
- 
-+elif os_name == 'mingw':
-+    BUILDDIR_TXT = 'pybuilddir.txt'
-+    BUILD_LANDMARK = f'Modules\\Setup.local'
-+    DEFAULT_PROGRAM_NAME = f'python{VERSION_MAJOR}'
-+    STDLIB_SUBDIR = f'{platlibdir}\\python{VERSION_MAJOR}.{VERSION_MINOR}'
-+    STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}\\os.py', f'{STDLIB_SUBDIR}\\os.pyc']
-+    PLATSTDLIB_LANDMARK = f'{platlibdir}\\python{VERSION_MAJOR}.{VERSION_MINOR}\\lib-dynload'
-+    BUILDSTDLIB_LANDMARKS = ['Lib\\os.py']
-+    VENV_LANDMARK = 'pyvenv.cfg'
-+    ZIP_LANDMARK = f'{platlibdir}\\python{VERSION_MAJOR}{VERSION_MINOR}.zip'
-+    DELIM = ';'
-+    SEP = '\\'
-+
- elif os_name == 'nt':
-     BUILDDIR_TXT = 'pybuilddir.txt'
-     DEFAULT_PROGRAM_NAME = f'python'
-@@ -453,7 +466,7 @@ if not py_setpath and not home_was_set:
-     # ._pth file, but it cannot override the library's one.
-     for p in [library, executable, real_executable]:
-         if p:
--            if os_name == 'nt' and (hassuffix(p, 'exe') or hassuffix(p, 'dll')):
-+            if (os_name == 'nt' or os_name == 'mingw') and (hassuffix(p, 'exe') or hassuffix(p, 'dll')):
-                 p = p.rpartition('.')[0]
-             p += '._pth'
-             try:

diff --git a/mingw-python3_pthread_threadid.patch b/mingw-python3_pthread_threadid.patch
deleted file mode 100644
index 57c17cb..0000000
--- a/mingw-python3_pthread_threadid.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Python/thread_pthread.h Python-3.11.16-new/Python/thread_pthread.h
---- Python-3.11.16/Python/thread_pthread.h	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Python/thread_pthread.h	2026-09-18 19:23:06.895330721 +0200
-@@ -352,6 +352,9 @@ PyThread_get_thread_native_id(void)
- #elif defined(__NetBSD__)
-     lwpid_t native_id;
-     native_id = _lwp_self();
-+#elif defined(__MINGW32__)
-+    pthread_t native_id;
-+    native_id = pthread_self();
- #endif
-     return (unsigned long) native_id;
- }

diff --git a/mingw-python3_pythonw.patch b/mingw-python3_pythonw.patch
deleted file mode 100644
index 2f869ac..0000000
--- a/mingw-python3_pythonw.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Makefile.pre.in Python-3.11.16-new/Makefile.pre.in
---- Python-3.11.16/Makefile.pre.in	2026-09-18 19:23:06.606947164 +0200
-+++ Python-3.11.16-new/Makefile.pre.in	2026-09-18 19:23:06.618200502 +0200
-@@ -284,6 +284,7 @@ LIBOBJS=	@LIBOBJS@
- 
- PYTHON=		python$(EXE)
- BUILDPYTHON=	python$(BUILDEXE)
-+BUILDPYTHONW=	pythonw$(BUILDEXE)
- 
- HOSTRUNNER= @HOSTRUNNER@
- 
-@@ -588,7 +589,7 @@ LIBEXPAT_HEADERS= \
- 
- # Default target
- all:		@DEF_MAKE_ALL_RULE@
--build_all:	check-clean-src $(BUILDPYTHON) platform oldsharedmods sharedmods \
-+build_all:	check-clean-src $(BUILDPYTHON) $(BUILDPYTHONW) platform oldsharedmods sharedmods \
- 		gdbhooks Programs/_testembed python-config
- build_wasm: check-clean-src $(BUILDPYTHON) platform oldsharedmods python-config
- 
-@@ -707,9 +708,29 @@ coverage-report: regen-token regen-froze
- clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
- 	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
- 
-+pythonnt_rc.h:
-+	# FIXME: FIELD3 not set
-+	@echo '#define FIELD3 0' > $@
-+	@echo '#define MS_DLL_ID "$(VERSION)"' >> $@
-+	@echo '#define PYTHON_DLL_NAME "$(DLLLIBRARY)"' >> $@
-+
-+python_exe.o: pythonnt_rc.h $(srcdir)/PC/python_exe.rc
-+	$(WINDRES) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_exe.rc $@
-+
-+pythonw_exe.o: pythonnt_rc.h $(srcdir)/PC/pythonw_exe.rc
-+	$(WINDRES) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/pythonw_exe.rc $@
-+
-+python_nt.o: pythonnt_rc.h $(srcdir)/PC/python_nt.rc
-+	$(WINDRES) -I$(srcdir)/Include -I$(srcdir)/PC -I. $(srcdir)/PC/python_nt.rc $@
-+
-+$(BUILDPYTHONW): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) pythonw_exe.o
-+	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -mwindows -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) pythonw_exe.o
-+
-+
-+
- # Build the interpreter
--$(BUILDPYTHON):	Programs/python.o $(LINK_PYTHON_DEPS)
--	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
-+$(BUILDPYTHON):	Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o
-+	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
- 
- platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
- 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
-@@ -813,10 +834,10 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION
- 
- # This rule builds the Cygwin Python DLL and import library if configured
- # for a shared core library; otherwise, this rule is a noop.
--$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
-+$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) python_nt.o
- 	if test -n "$(DLLLIBRARY)"; then \
- 		$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
--			$(LIBS) $(MODLIBS) $(SYSLIBS); \
-+			$(LIBS) $(MODLIBS) $(SYSLIBS) python_nt.o; \
- 	else true; \
- 	fi
- 
-@@ -1810,6 +1831,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
- 	done
- 	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
- 		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
-+		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
- 	else \
- 		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
- 	fi
-diff -rupN --no-dereference Python-3.11.16/PC/python_exe.rc Python-3.11.16-new/PC/python_exe.rc
---- Python-3.11.16/PC/python_exe.rc	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/PC/python_exe.rc	2026-09-18 19:23:06.619725166 +0200
-@@ -12,7 +12,7 @@
- // current versions of Windows.
- 1 RT_MANIFEST "python.manifest"
- 
--1 ICON DISCARDABLE "icons\python.ico" 
-+1 ICON DISCARDABLE "icons/python.ico"
- 
- 
- /////////////////////////////////////////////////////////////////////////////
-diff -rupN --no-dereference Python-3.11.16/PC/python_nt.rc Python-3.11.16-new/PC/python_nt.rc
---- Python-3.11.16/PC/python_nt.rc	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/PC/python_nt.rc	2026-09-18 19:23:06.620293734 +0200
-@@ -39,7 +39,7 @@ BEGIN
-             VALUE "FileVersion", PYTHON_VERSION
-             VALUE "InternalName", "Python DLL\0"
-             VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
--            VALUE "OriginalFilename", ORIGINAL_FILENAME "\0"
-+            VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
-             VALUE "ProductName", "Python\0"
-             VALUE "ProductVersion", PYTHON_VERSION
-         END
-diff -rupN --no-dereference Python-3.11.16/PC/python_ver_rc.h Python-3.11.16-new/PC/python_ver_rc.h
---- Python-3.11.16/PC/python_ver_rc.h	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/PC/python_ver_rc.h	2026-09-18 19:23:06.620824836 +0200
-@@ -3,6 +3,7 @@
- //
- #pragma code_page(1252)
- #include "winver.h"
-+#include "pythonnt_rc.h"
- 
- #define PYTHON_COMPANY   "Python Software Foundation"
- #define PYTHON_COPYRIGHT "Copyright \xA9 2001-2023 Python Software Foundation. Copyright \xA9 2000 BeOpen.com. Copyright \xA9 1995-2001 CNRI. Copyright \xA9 1991-1995 SMC."
-diff -rupN --no-dereference Python-3.11.16/PC/pythonw_exe.rc Python-3.11.16-new/PC/pythonw_exe.rc
---- Python-3.11.16/PC/pythonw_exe.rc	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/PC/pythonw_exe.rc	2026-09-18 19:23:06.621350873 +0200
-@@ -12,7 +12,7 @@
- // current versions of Windows.
- 1 RT_MANIFEST "python.manifest"
- 
--1 ICON DISCARDABLE "icons\pythonw.ico" 
-+1 ICON DISCARDABLE "icons/pythonw.ico"
- 
- 
- /////////////////////////////////////////////////////////////////////////////
-diff -rupN --no-dereference Python-3.11.16/Programs/python.c Python-3.11.16-new/Programs/python.c
---- Python-3.11.16/Programs/python.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Programs/python.c	2026-09-18 19:23:06.621947191 +0200
-@@ -8,10 +8,9 @@ wmain(int argc, wchar_t **argv)
- {
-     return Py_Main(argc, argv);
- }
--#else
-+#endif
- int
- main(int argc, char **argv)
- {
-     return Py_BytesMain(argc, argv);
- }
--#endif

diff --git a/mingw-python3_setenv.patch b/mingw-python3_setenv.patch
deleted file mode 100644
index cb8c0cb..0000000
--- a/mingw-python3_setenv.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Python/pylifecycle.c Python-3.11.16-new/Python/pylifecycle.c
---- Python-3.11.16/Python/pylifecycle.c	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Python/pylifecycle.c	2026-09-18 19:23:06.036851690 +0200
-@@ -61,6 +61,27 @@ extern void _PyIO_Fini(void);
- 
- #define PUTS(fd, str) _Py_write_noraise(fd, str, (int)strlen(str))
- 
-+#if defined(__MINGW32__) && defined(PY_COERCE_C_LOCALE)
-+#include <windows.h>
-+
-+static int
-+setenv (const char *var, const char *val, int ovr)
-+{
-+  BOOL b;
-+  char c[2];
-+  if (!ovr)
-+  {
-+    DWORD d;
-+    d = GetEnvironmentVariableA (var, c, 2);
-+    if (0 != d && GetLastError () != ERROR_ENVVAR_NOT_FOUND)
-+      return 1;
-+  }
-+  b = SetEnvironmentVariableA (var, val);
-+  if (b)
-+    return 0;
-+  return 1;
-+}
-+#endif
- 
- #ifdef __cplusplus
- extern "C" {

diff --git a/mingw-python3_win-modules.patch b/mingw-python3_win-modules.patch
deleted file mode 100644
index 7b2848d..0000000
--- a/mingw-python3_win-modules.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -rupN --no-dereference Python-3.11.16/Modules/Setup Python-3.11.16-new/Modules/Setup
---- Python-3.11.16/Modules/Setup	2026-09-18 19:23:08.202833836 +0200
-+++ Python-3.11.16-new/Modules/Setup	2026-09-18 19:23:08.460113755 +0200
-@@ -270,6 +270,12 @@ mmap mmapmodule.c
- # macOS specific module, needs SystemConfiguration and CoreFoundation framework
- # _scproxy _scproxy.c
- 
-+# Windows specific modules
-+msvcrt ../PC/msvcrtmodule.c
-+_winapi _winapi.c
-+winsound ../PC/winsound.c -lwinmm
-+_overlapped overlapped.c
-+
- # Examples
- 
- #xx xxmodule.c
-diff -rupN --no-dereference Python-3.11.16/Modules/Setup.bootstrap.in Python-3.11.16-new/Modules/Setup.bootstrap.in
---- Python-3.11.16/Modules/Setup.bootstrap.in	2026-08-13 01:03:19.000000000 +0200
-+++ Python-3.11.16-new/Modules/Setup.bootstrap.in	2026-09-18 19:23:08.460569376 +0200
-@@ -8,15 +8,15 @@
- # module C APIs are used in core
- atexit atexitmodule.c
- faulthandler faulthandler.c
--posix posixmodule.c
--_signal signalmodule.c
-+nt posixmodule.c
-+_signal signalmodule.c -lws2_32
- _tracemalloc _tracemalloc.c
- 
- # modules used by importlib, deepfreeze, freeze, runpy, and sysconfig
- _codecs _codecsmodule.c
- _collections _collectionsmodule.c
- errno errnomodule.c
--_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
-+_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c
- itertools itertoolsmodule.c
- _sre _sre/sre.c
- _thread _threadmodule.c
-@@ -33,3 +33,5 @@ _symtable symtablemodule.c
- 
- # for systems without $HOME env, used by site._getuserbase()
- @MODULE_PWD_TRUE@pwd pwdmodule.c
-+
-+winreg ../PC/winreg.c
-diff -rupN --no-dereference Python-3.11.16/setup.py Python-3.11.16-new/setup.py
---- Python-3.11.16/setup.py	2026-09-18 19:23:08.203119714 +0200
-+++ Python-3.11.16-new/setup.py	2026-09-18 19:23:08.460918402 +0200
-@@ -1382,6 +1382,15 @@ class PyBuildExt(build_ext):
-         self.addext(Extension('xxlimited', ['xxlimited.c']))
-         self.addext(Extension('xxlimited_35', ['xxlimited_35.c']))
- 
-+        # Modules with some Windows dependencies:
-+        if HOST_PLATFORM.startswith(('mingw', 'win')):
-+            srcdir = sysconfig.get_config_var('srcdir')
-+            pc_srcdir = os.path.abspath(os.path.join(srcdir, 'PC'))
-+
-+            self.add(Extension('_msi', [os.path.join(pc_srcdir, p)
-+                for p in ['_msi.c']],
-+                libraries=['msi','cabinet','rpcrt4']) ) # To link with lib(msi|cabinet|rpcrt4).a
-+
-     def detect_tkinter(self):
-         tkinter_libs = ['tcl', 'tk']
-         self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], libraries=tkinter_libs))

diff --git a/sources b/sources
index d270a50..b9ecadd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-3.11.16.tar.xz) = f4e168d35596c2df080663d8e8b3472f03bace987d46b49b8410f2425ba193215b9880c7d03d4653ec31c83b72209d95866fc1cb6d666799145075b092f64a48
+SHA512 (Python-3.14.7.tar.xz) = 3d4e2e2f983b320dec47005c408d7178d3656a6de0c4430ce21514797174b972f461200898b25d3dfac2a455019ef87e45d0fb2bb6ec2ca887124d10037a2a07

                 reply	other threads:[~2026-09-23 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179017994285.1.3033290796824066764.rpms-mingw-python3-60d707afd579@fedoraproject.org \
    --to=manisandro@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox