Files
MINGW-packages/mingw-w64-python3/0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch
Алексей edc01d04d6 Update python to 3.7.0 (#4047)
* Initial python-3.7 port

* python3: Add setup.config.in to remove before patching

* python3: Implement setenv for mingw. Fix building with NT threads. Build
with unicode

* Fix typos

* Fix linking core modules

* Mingw build have exec_prefix

* Remove deprecated patch

* Fix building python and modules. Failing to build readline module and
install not working yet

* More getpath changes and more aggressive path separator conversion

* Fix readline module compilation and linking errors

* python3: By default building with posix threads, NT threads are broken.
Some patches optimization. First buildable commit

* Py_DecodeLocale handle char, not wchar

* Fix building multiprocessing module with posix threads
2018-07-06 09:57:52 +03:00

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-06-30 11:15:30.264541200 +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-06-30 11:15:30.280141200 +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.