Files
MINGW-packages/mingw-w64-python3/0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch

51 lines
2.3 KiB
Diff

diff -Naur Python-3.7.0-orig/Lib/distutils/spawn.py Python-3.7.0/Lib/distutils/spawn.py
--- Python-3.7.0-orig/Lib/distutils/spawn.py 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/Lib/distutils/spawn.py 2018-07-12 10:20:40.437481700 +0300
@@ -12,6 +12,7 @@
from distutils.errors import DistutilsPlatformError, DistutilsExecError
from distutils.debug import DEBUG
from distutils import log
+from subprocess import list2cmdline
def spawn(cmd, search_path=1, verbose=0, dry_run=0):
"""Run another program, specified as a command list 'cmd', in a new process.
@@ -43,17 +44,13 @@
def _nt_quote_args(args):
"""Quote command-line arguments for DOS/Windows conventions.
- Just wraps every argument which contains blanks in double quotes, and
- returns a new argument list.
+ Defer to subprocess module's list2cmdline as the logic is
+ complex. The previous implementation here failed to handle
+ -DG_LOG_DOMAIN="GEGL-"__FILE__ which was encountered in MSYS2
+ while building the gobject-introspection part of GEGL 0.3.4.
"""
- # XXX this doesn't seem very robust to me -- but if the Windows guys
- # say it'll work, I guess I'll have to accept it. (What if an arg
- # contains quotes? What other magic characters, other than spaces,
- # have to be escaped? Is there an escaping mechanism other than
- # quoting?)
for i, arg in enumerate(args):
- if ' ' in arg:
- args[i] = '"%s"' % arg
+ args[i] = list2cmdline([args[i]])
return args
def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
diff -Naur Python-3.7.0-orig/setup.py Python-3.7.0/setup.py
--- Python-3.7.0-orig/setup.py 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/setup.py 2018-07-12 10:20:40.437481700 +0300
@@ -1198,11 +1198,7 @@
'_sqlite/statement.c',
'_sqlite/util.c', ]
- sqlite_defines = []
- if host_platform != "win32":
- sqlite_defines.append(('MODULE_NAME', '"sqlite3"'))
- else:
- sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
+ sqlite_defines = [('MODULE_NAME', '"sqlite3"')]
# Enable support for loadable extensions in the sqlite3 module
# if --enable-loadable-sqlite-extensions configure option is used.