File subprocess-posix-spawn.patch of Package python313
Index: Python-3.13.2/Lib/subprocess.py
===================================================================
--- Python-3.13.2.orig/Lib/subprocess.py
+++ Python-3.13.2/Lib/subprocess.py
@@ -734,6 +734,13 @@ def _use_posix_spawn():
version = tuple(map(int, parts[1].split('.')))
if sys.platform == 'linux' and libc == 'glibc' and version >= (2, 24):
+ try:
+ with open('/proc/cpuinfo', encoding='ascii') as f:
+ while (line := f.readline()) != '':
+ if line.startswith('uarch') and 'qemu' in line:
+ return False
+ except:
+ pass
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
# which properly reports errors to the parent process.
return True