summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2014-03-27 21:21:24 -0400
committerMike Gilbert <floppym@gentoo.org>2014-03-27 21:21:24 -0400
commitfe4360fce5e9e66837ccf8fcb7948ef9993a2468 (patch)
tree0b1faeb686f5dd40a534e18065ea1ae94bd1b4eb
parentUpdates for 3.3.5 (diff)
downloadpython-gentoo-patches-fe4360fce5e9e66837ccf8fcb7948ef9993a2468.tar.gz
python-gentoo-patches-fe4360fce5e9e66837ccf8fcb7948ef9993a2468.tar.bz2
python-gentoo-patches-fe4360fce5e9e66837ccf8fcb7948ef9993a2468.zip
Updates for 3.4.03.4.0-0
-rw-r--r--patches/01_all_static_library_location.patch37
-rw-r--r--patches/02_all_disable_modules_and_ssl.patch10
-rw-r--r--patches/03_all_libdir.patch42
-rw-r--r--patches/04_all_non-zero_exit_status_on_failure.patch6
-rw-r--r--patches/05_all_regenerate_platform-specific_modules.patch16
-rw-r--r--patches/21_all_distutils_c++.patch69
-rw-r--r--patches/22_all_tests_environment.patch124
-rw-r--r--patches/24_all_sqlite-3.8.4.patch2
-rw-r--r--patches/61_all_process_data.patch73
9 files changed, 181 insertions, 198 deletions
diff --git a/patches/01_all_static_library_location.patch b/patches/01_all_static_library_location.patch
index 36ac67a..eda2c9d 100644
--- a/patches/01_all_static_library_location.patch
+++ b/patches/01_all_static_library_location.patch
@@ -4,9 +4,9 @@ http://bugs.python.org/issue6103
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -965,6 +965,19 @@
- fi; \
- else true; \
+@@ -989,6 +989,19 @@
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
fi
+ @if test -f $(LIBRARY) && test $(LIBRARY) != $(LDLIBRARY); then \
+ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
@@ -22,9 +22,9 @@ http://bugs.python.org/issue6103
+ else true; \
+ fi
- bininstall: altbininstall
- -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
-@@ -1200,18 +1213,6 @@
+ commoninstall: @FRAMEWORKALTINSTALLFIRST@ \
+ altbininstall libinstall inclinstall libainstall \
+@@ -1309,18 +1322,6 @@
else true; \
fi; \
done
@@ -45,7 +45,7 @@ http://bugs.python.org/issue6103
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
--- Misc/python-config.in
+++ Misc/python-config.in
-@@ -47,11 +47,7 @@
+@@ -49,11 +49,7 @@
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython' + pyver + sys.abiflags)
@@ -57,6 +57,29 @@ http://bugs.python.org/issue6103
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))
+--- Misc/python-config.sh.in
++++ Misc/python-config.sh.in
+@@ -45,7 +45,6 @@
+ LDLIBRARY="@LDLIBRARY@"
+ LINKFORSHARED="@LINKFORSHARED@"
+ OPT="@OPT@"
+-PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
+ LDVERSION="@LDVERSION@"
+ LIBDEST=${prefix}/lib/python${VERSION}
+ LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
+@@ -92,11 +91,7 @@
+ if [ -z "$PYTHONFRAMEWORK" ] ; then
+ LINKFORSHAREDUSED=$LINKFORSHARED
+ fi
+- LIBPLUSED=
+- if [ "$PY_ENABLE_SHARED" = "0" ] ; then
+- LIBPLUSED="-L$LIBPL"
+- fi
+- echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
++ echo "-L$libdir $LIBS $LINKFORSHAREDUSED"
+ ;;
+ --extension-suffix)
+ echo "$SO"
--- Modules/makesetup
+++ Modules/makesetup
@@ -89,7 +89,7 @@
diff --git a/patches/02_all_disable_modules_and_ssl.patch b/patches/02_all_disable_modules_and_ssl.patch
index af735be..a8bd8e4 100644
--- a/patches/02_all_disable_modules_and_ssl.patch
+++ b/patches/02_all_disable_modules_and_ssl.patch
@@ -1,6 +1,6 @@
--- setup.py
+++ setup.py
-@@ -31,7 +31,17 @@
+@@ -33,7 +33,17 @@
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
@@ -19,7 +19,7 @@
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (after any relative
-@@ -435,6 +445,7 @@
+@@ -441,6 +451,7 @@
os.unlink(tmpfile)
def detect_modules(self):
@@ -27,7 +27,7 @@
# Ensure that /usr/local is always used, but the local build
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
-@@ -747,7 +758,7 @@
+@@ -757,7 +768,7 @@
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
search_for_ssl_incs_in
)
@@ -36,7 +36,7 @@
krb5_h = find_file('krb5.h', inc_dirs,
['/usr/kerberos/include'])
if krb5_h:
-@@ -758,7 +769,8 @@
+@@ -768,7 +779,8 @@
] )
if (ssl_incs is not None and
@@ -46,7 +46,7 @@
exts.append( Extension('_ssl', ['_ssl.c'],
include_dirs = ssl_incs,
library_dirs = ssl_libs,
-@@ -791,7 +803,7 @@
+@@ -801,7 +813,7 @@
#print('openssl_ver = 0x%08x' % openssl_ver)
min_openssl_ver = 0x00907000
diff --git a/patches/03_all_libdir.patch b/patches/03_all_libdir.patch
index 052c51d..b0b68ee 100644
--- a/patches/03_all_libdir.patch
+++ b/patches/03_all_libdir.patch
@@ -13,7 +13,7 @@
'data' : '$base',
--- Lib/distutils/sysconfig.py
+++ Lib/distutils/sysconfig.py
-@@ -144,7 +144,7 @@
+@@ -142,7 +142,7 @@
if os.name == "posix":
libpython = os.path.join(prefix,
@@ -24,10 +24,10 @@
else:
--- Lib/site.py
+++ Lib/site.py
-@@ -303,10 +303,10 @@
- if sys.platform in ('os2emx', 'riscos'):
- sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
- elif os.sep == '/':
+@@ -304,10 +304,10 @@
+ seen.add(prefix)
+
+ if os.sep == '/':
- sitepackages.append(os.path.join(prefix, "lib",
+ sitepackages.append(os.path.join(prefix, "@@GENTOO_LIBDIR@@",
"python" + sys.version[:3],
@@ -39,7 +39,7 @@
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
--- Lib/sysconfig.py
+++ Lib/sysconfig.py
-@@ -21,10 +21,10 @@
+@@ -20,10 +20,10 @@
_INSTALL_SCHEMES = {
'posix_prefix': {
@@ -54,7 +54,7 @@
'include':
'{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude':
-@@ -81,10 +81,10 @@
+@@ -61,10 +61,10 @@
'data': '{userbase}',
},
'posix_user': {
@@ -71,7 +71,7 @@
'data': '{userbase}',
--- Lib/test/test_site.py
+++ Lib/test/test_site.py
-@@ -248,10 +248,10 @@
+@@ -244,10 +244,10 @@
elif os.sep == '/':
# OS X non-framwework builds, Linux, FreeBSD, etc
self.assertEqual(len(dirs), 2)
@@ -97,7 +97,7 @@
# Detailed destination directories
--- Modules/getpath.c
+++ Modules/getpath.c
-@@ -122,8 +122,8 @@
+@@ -118,8 +118,8 @@
#endif
#ifndef PYTHONPATH
@@ -108,16 +108,16 @@
#endif
#ifndef LANDMARK
-@@ -135,7 +135,7 @@
- static wchar_t progpath[MAXPATHLEN+1];
- static wchar_t *module_search_path = NULL;
- static int module_search_path_malloced = 0;
--static wchar_t *lib_python = L"lib/python" VERSION;
-+static wchar_t *lib_python = L"@@GENTOO_LIBDIR@@/python" VERSION;
+@@ -494,7 +494,7 @@
+ _pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
+ _prefix = _Py_char2wchar(PREFIX, NULL);
+ _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
+- lib_python = _Py_char2wchar("lib/python" VERSION, NULL);
++ lib_python = _Py_char2wchar("@@GENTOO_LIBDIR@@/python" VERSION, NULL);
- static void
- reduce(wchar_t *dir)
-@@ -685,7 +685,7 @@
+ if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+ Py_FatalError(
+@@ -683,7 +683,7 @@
}
else
wcsncpy(zip_path, _prefix, MAXPATHLEN);
@@ -137,7 +137,7 @@
--- Modules/Setup.dist
+++ Modules/Setup.dist
-@@ -354,7 +354,7 @@
+@@ -358,7 +358,7 @@
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
@@ -148,7 +148,7 @@
#
--- setup.py
+++ setup.py
-@@ -507,8 +507,7 @@
+@@ -513,8 +513,7 @@
# be assumed that no additional -I,-L directives are needed.
if not cross_compiling:
lib_dirs = self.compiler.library_dirs + [
@@ -158,7 +158,7 @@
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
else:
-@@ -723,11 +722,11 @@
+@@ -733,11 +732,11 @@
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
diff --git a/patches/04_all_non-zero_exit_status_on_failure.patch b/patches/04_all_non-zero_exit_status_on_failure.patch
index 58b839f..e8e22bb 100644
--- a/patches/04_all_non-zero_exit_status_on_failure.patch
+++ b/patches/04_all_non-zero_exit_status_on_failure.patch
@@ -3,7 +3,7 @@ http://bugs.python.org/issue6731
--- setup.py
+++ setup.py
-@@ -43,6 +43,8 @@
+@@ -45,6 +45,8 @@
else:
disable_ssl = 0
@@ -12,7 +12,7 @@ http://bugs.python.org/issue6731
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (after any relative
directories) if:
-@@ -277,6 +279,8 @@
+@@ -280,6 +282,8 @@
print()
if self.failed:
@@ -21,7 +21,7 @@ http://bugs.python.org/issue6731
failed = self.failed[:]
print()
print("Failed to build these modules:")
-@@ -2213,6 +2217,7 @@
+@@ -2219,6 +2223,7 @@
scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
"Tools/scripts/2to3", "Tools/scripts/pyvenv"]
)
diff --git a/patches/05_all_regenerate_platform-specific_modules.patch b/patches/05_all_regenerate_platform-specific_modules.patch
index 68f33f7..fd86c3c 100644
--- a/patches/05_all_regenerate_platform-specific_modules.patch
+++ b/patches/05_all_regenerate_platform-specific_modules.patch
@@ -37,16 +37,16 @@ http://bugs.python.org/issue12619
+python$EXE ../../Tools/scripts/h2py.py /usr/include/sys/stropts.h
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -444,7 +444,7 @@
+@@ -459,7 +459,7 @@
# Default target
all: build_all
--build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
-+build_all: $(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods gdbhooks Modules/_testembed
+-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed python-config
++build_all: $(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods gdbhooks Modules/_testembed python-config
# Compile a binary with gcc profile guided optimization.
profile-opt:
-@@ -500,6 +500,32 @@
+@@ -557,6 +557,32 @@
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
@@ -79,7 +79,7 @@ http://bugs.python.org/issue12619
# Build static library
# avoid long command lines, same as LIBRARY_OBJS
$(LIBRARY): $(LIBRARY_OBJS)
-@@ -1074,7 +1100,7 @@
+@@ -1174,7 +1200,7 @@
unittest unittest/test unittest/test/testmock \
venv venv/scripts venv/scripts/posix \
curses pydoc_data $(MACHDEPS)
@@ -88,7 +88,7 @@ http://bugs.python.org/issue12619
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $(DESTDIR)$$i; then \
-@@ -1157,23 +1183,6 @@
+@@ -1257,23 +1283,6 @@
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
@@ -109,10 +109,10 @@ http://bugs.python.org/issue12619
- fi; \
- cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-
- python-config: $(srcdir)/Misc/python-config.in
+ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
-@@ -1476,7 +1485,7 @@
+@@ -1595,7 +1604,7 @@
Python/thread.o: @THREADHEADERS@
# Declare targets that aren't real files
diff --git a/patches/21_all_distutils_c++.patch b/patches/21_all_distutils_c++.patch
index 1f6c19a..d436573 100644
--- a/patches/21_all_distutils_c++.patch
+++ b/patches/21_all_distutils_c++.patch
@@ -2,7 +2,7 @@ http://bugs.python.org/issue1222585
--- Lib/distutils/cygwinccompiler.py
+++ Lib/distutils/cygwinccompiler.py
-@@ -124,8 +124,10 @@
+@@ -125,8 +125,10 @@
# dllwrap 2.10.90 is buggy
if self.ld_version >= "2.10.90":
self.linker_dll = "gcc"
@@ -13,7 +13,7 @@ http://bugs.python.org/issue1222585
# ld_version >= "2.13" support -shared so use it instead of
# -mdll -static
-@@ -139,9 +141,13 @@
+@@ -140,9 +142,13 @@
self.set_executables(compiler='gcc -mcygwin -O -Wall',
compiler_so='gcc -mcygwin -mdll -O -Wall',
compiler_cxx='g++ -mcygwin -O -Wall',
@@ -28,7 +28,7 @@ http://bugs.python.org/issue1222585
# cygwin and mingw32 need different sets of libraries
if self.gcc_version == "2.91.57":
-@@ -165,8 +171,12 @@
+@@ -166,8 +172,12 @@
raise CompileError(msg)
else: # for other files use the C-compiler
try:
@@ -44,54 +44,23 @@ http://bugs.python.org/issue1222585
raise CompileError(msg)
@@ -302,9 +312,14 @@
- self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
- compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
- compiler_cxx='g++%s -O -Wall' % no_cygwin,
-+ compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin,
- linker_exe='gcc%s' % no_cygwin,
- linker_so='%s%s %s %s'
- % (self.linker_dll, no_cygwin,
-+ shared_option, entry_point),
-+ linker_exe_cxx='g++%s' % no_cygwin,
-+ linker_so_cxx='%s%s %s %s'
-+ % (self.linker_dll_cxx, no_cygwin,
- shared_option, entry_point))
+ self.set_executables(compiler='gcc -O -Wall',
+ compiler_so='gcc -mdll -O -Wall',
+ compiler_cxx='g++ -O -Wall',
++ compiler_so_cxx='g++ -mdll -O -Wall',
+ linker_exe='gcc',
+ linker_so='%s %s %s'
+ % (self.linker_dll, shared_option,
++ entry_point),
++ linker_exe_cxx='g++',
++ linker_so_cxx='%s %s %s'
++ % (self.linker_dll_cxx, shared_option,
+ entry_point))
# Maybe we should also append -mthreads, but then the finished
# dlls need another dll (mingwm10.dll see Mingw32 docs)
---- Lib/distutils/emxccompiler.py
-+++ Lib/distutils/emxccompiler.py
-@@ -63,8 +63,12 @@
- # XXX optimization, warnings etc. should be customizable.
- self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
- compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-+ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-+ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
- linker_exe='gcc -Zomf -Zmt -Zcrtdll',
-- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
-+ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
-+ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
-+ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
-
- # want the gcc library statically linked (so that we don't have
- # to distribute a version dependent on the compiler we have)
-@@ -81,8 +85,12 @@
- raise CompileError(msg)
- else: # for other files use the C-compiler
- try:
-- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
-- extra_postargs)
-+ if self.detect_language(src) == 'c++':
-+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
-+ extra_postargs)
-+ else:
-+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
-+ extra_postargs)
- except DistutilsExecError as msg:
- raise CompileError(msg)
-
--- Lib/distutils/sysconfig.py
+++ Lib/distutils/sysconfig.py
-@@ -191,9 +191,12 @@
+@@ -184,9 +184,12 @@
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
@@ -107,7 +76,7 @@ http://bugs.python.org/issue1222585
if 'CC' in os.environ:
newcc = os.environ['CC']
-@@ -208,19 +211,27 @@
+@@ -201,19 +204,27 @@
cxx = os.environ['CXX']
if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
@@ -136,7 +105,7 @@ http://bugs.python.org/issue1222585
if 'AR' in os.environ:
ar = os.environ['AR']
if 'ARFLAGS' in os.environ:
-@@ -229,13 +240,17 @@
+@@ -222,13 +233,17 @@
archiver = ar + ' ' + ar_flags
cc_cmd = cc + ' ' + cflags
@@ -260,7 +229,7 @@ http://bugs.python.org/issue1222585
_INITPRE = '_OSX_SUPPORT_INITIAL_'
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -496,7 +496,7 @@
+@@ -553,7 +553,7 @@
*\ -s*|s*) quiet="-q";; \
*) quiet="";; \
esac; \
diff --git a/patches/22_all_tests_environment.patch b/patches/22_all_tests_environment.patch
index edb3351..3224770 100644
--- a/patches/22_all_tests_environment.patch
+++ b/patches/22_all_tests_environment.patch
@@ -2,7 +2,7 @@ http://bugs.python.org/issue1674555
--- Lib/site.py
+++ Lib/site.py
-@@ -587,8 +587,9 @@
+@@ -540,8 +540,9 @@
known_paths = venv(known_paths)
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
@@ -11,12 +11,12 @@ http://bugs.python.org/issue1674555
+ if os.environ.get("_PYTHONNOSITEPACKAGES") is None:
+ known_paths = addusersitepackages(known_paths)
+ known_paths = addsitepackages(known_paths)
- if sys.platform == 'os2emx':
- setBEGINLIBPATH()
setquit()
+ setcopyright()
+ sethelper()
--- Lib/test/regrtest.py
+++ Lib/test/regrtest.py
-@@ -188,6 +188,7 @@
+@@ -143,6 +143,7 @@
import unittest
import warnings
from inspect import isabstract
@@ -24,37 +24,39 @@ http://bugs.python.org/issue1674555
try:
import threading
-@@ -578,6 +579,62 @@
- support.use_resources = use_resources
+@@ -432,7 +433,6 @@
+ subprocess exits, its return code, stdout and stderr are returned as a
+ 3-tuple.
+ """
+- from subprocess import Popen, PIPE
+ base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
+ ['-X', 'faulthandler', '-m', 'test.regrtest'])
+
+@@ -643,6 +643,56 @@
+ support.use_resources = ns.use_resources
save_modules = sys.modules.keys()
+ opt_args = support.args_from_interpreter_flags()
-+ base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
-+ debug_output_pat = re.compile(r"\[\d+ refs\]$")
-+
-+ def get_args_tuple(test, verbose, quiet, huntrleaks, debug, use_resources,
-+ output_on_failure, failfast, match_tests, timeout):
-+ return (
-+ (test, verbose, quiet),
-+ dict(huntrleaks=huntrleaks, debug=debug,
-+ use_resources=use_resources,
-+ output_on_failure=output_on_failure, failfast=failfast,
-+ match_tests=match_tests, timeout=timeout)
-+ )
++ base_cmd = [sys.executable] + opt_args
++ base_cmd += ['-X', 'faulthandler', '-m', 'test.regrtest']
++ debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
+
-+ def _runtest(test, verbose, quiet, huntrleaks=False, debug=False,
-+ use_resources=None, output_on_failure=False, failfast=False,
-+ match_tests=None, timeout=None):
++ def _runtest(test, verbose, quiet, huntrleaks=False, use_resources=None,
++ output_on_failure=False, failfast=False, match_tests=None,
++ timeout=None):
+ if test == "test_site":
-+ args_tuple = get_args_tuple(test, verbose, quiet, huntrleaks, debug,
-+ use_resources, output_on_failure,
-+ failfast, match_tests, timeout)
++ slaveargs = ((test, verbose, quiet),
++ dict(huntrleaks=huntrleaks,
++ use_resources=use_resources,
++ output_on_failure=output_on_failure,
++ timeout=timeout, failfast=failfast,
++ match_tests=match_tests))
+ env = os.environ.copy()
+ try:
+ del env["_PYTHONNOSITEPACKAGES"]
+ except KeyError:
+ pass
-+ popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
++ popen = Popen(base_cmd + ['--slaveargs', json.dumps(slaveargs)],
+ stdout=PIPE, stderr=PIPE,
+ universal_newlines=True,
+ close_fds=(os.name != 'nt'),
@@ -79,7 +81,7 @@ http://bugs.python.org/issue1674555
+ return result
+ else:
+ return runtest(test, verbose, quiet, huntrleaks=huntrleaks,
-+ debug=debug, use_resources=use_resources,
++ use_resources=use_resources,
+ output_on_failure=output_on_failure,
+ failfast=failfast, match_tests=match_tests,
+ timeout=timeout)
@@ -87,66 +89,48 @@ http://bugs.python.org/issue1674555
def accumulate_result(test, result):
ok, test_time = result
test_times.append((test_time, test))
-@@ -615,12 +672,8 @@
+@@ -680,7 +730,6 @@
print("Multiprocess option requires thread support")
sys.exit(2)
from queue import Queue
-- from subprocess import Popen, PIPE
-- debug_output_pat = re.compile(r"\[\d+ refs\]$")
+- debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
output = Queue()
pending = MultiprocessTests(tests)
-- opt_args = support.args_from_interpreter_flags()
-- base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
def work():
- # A worker thread.
- try:
-@@ -630,13 +683,9 @@
- except StopIteration:
- output.put((None, None, None, None))
- return
-- args_tuple = (
-- (test, verbose, quiet),
-- dict(huntrleaks=huntrleaks, use_resources=use_resources,
-- debug=debug, output_on_failure=verbose3,
-- timeout=timeout, failfast=failfast,
-- match_tests=match_tests)
-- )
-+ args_tuple = get_args_tuple(test, verbose, quiet, huntrleaks,
-+ debug, use_resources, verbose3,
-+ failfast, match_tests, timeout)
- # -E is needed by some tests, e.g. test_import
- # Running the child from the same working directory ensures
- # that TEMPDIR for the child is the same when
-@@ -707,14 +756,14 @@
- if trace:
+@@ -752,15 +801,15 @@
+ if ns.trace:
# If we're tracing code coverage, then we don't exit with status
# if on a false return value from main.
-- tracer.runctx('runtest(test, verbose, quiet, timeout=timeout)',
-+ tracer.runctx('_runtest(test, verbose, quiet, timeout=timeout)',
+- tracer.runctx('runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)',
++ tracer.runctx('_runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)',
globals=globals(), locals=vars())
else:
try:
-- result = runtest(test, verbose, quiet, huntrleaks, debug,
-- output_on_failure=verbose3,
-- timeout=timeout, failfast=failfast,
-- match_tests=match_tests)
-+ result = _runtest(test, verbose, quiet, huntrleaks, debug,
-+ output_on_failure=verbose3,
-+ timeout=timeout, failfast=failfast,
-+ match_tests=match_tests)
+- result = runtest(test, ns.verbose, ns.quiet,
+- ns.huntrleaks,
+- output_on_failure=ns.verbose3,
+- timeout=ns.timeout, failfast=ns.failfast,
+- match_tests=ns.match_tests)
++ result = _runtest(test, ns.verbose, ns.quiet,
++ ns.huntrleaks,
++ output_on_failure=ns.verbose3,
++ timeout=ns.timeout, failfast=ns.failfast,
++ match_tests=ns.match_tests)
accumulate_result(test, result)
except KeyboardInterrupt:
interrupted = True
-@@ -785,7 +834,7 @@
+@@ -817,8 +866,8 @@
sys.stdout.flush()
try:
- verbose = True
-- ok = runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
-+ ok = _runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
+ ns.verbose = True
+- ok = runtest(test, True, ns.quiet, ns.huntrleaks,
+- timeout=ns.timeout)
++ ok = _runtest(test, True, ns.quiet, ns.huntrleaks,
++ timeout=ns.timeout)
except KeyboardInterrupt:
# print a newline separate from the ^C
print()
-@@ -1182,8 +1231,9 @@
+@@ -1239,8 +1288,9 @@
for name, get, restore in self.resource_info():
current = get()
original = saved_values.pop(name)
@@ -164,7 +148,7 @@ http://bugs.python.org/issue1674555
import test.support
from test.support import captured_stderr, TESTFN, EnvironmentVarGuard
import builtins
-+import imp
++import importlib
import os
import sys
import re
@@ -174,14 +158,14 @@ http://bugs.python.org/issue1674555
+if "_PYTHONNOSITEPACKAGES" in os.environ:
+ del os.environ["_PYTHONNOSITEPACKAGES"]
-+ imp.reload(site)
++ importlib.reload(site)
+
if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
# need to add user site directory for tests
os.makedirs(site.USER_SITE)
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -883,7 +883,7 @@
+@@ -944,7 +944,7 @@
######################################################################
TESTOPTS= $(EXTRATESTOPTS)
diff --git a/patches/24_all_sqlite-3.8.4.patch b/patches/24_all_sqlite-3.8.4.patch
index d6af2eb..75ac6ac 100644
--- a/patches/24_all_sqlite-3.8.4.patch
+++ b/patches/24_all_sqlite-3.8.4.patch
@@ -1,5 +1,5 @@
http://bugs.python.org/issue20901
-http://hg.python.org/cpython/rev/dbc9e3ed5e9f
+http://hg.python.org/cpython/rev/4d626a9df062
--- Lib/sqlite3/test/hooks.py
+++ Lib/sqlite3/test/hooks.py
diff --git a/patches/61_all_process_data.patch b/patches/61_all_process_data.patch
index b7738c7..7b7e126 100644
--- a/patches/61_all_process_data.patch
+++ b/patches/61_all_process_data.patch
@@ -9,7 +9,7 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
--- Modules/main.c
+++ Modules/main.c
-@@ -331,6 +331,7 @@
+@@ -343,6 +343,7 @@
int version = 0;
int saw_unbuffered_flag = 0;
PyCompilerFlags cf;
@@ -17,10 +17,10 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
cf.cf_flags = 0;
-@@ -551,7 +552,17 @@
- filename = argv[_PyOS_optind];
-
- #else
+@@ -563,7 +564,17 @@
+ if (command == NULL && module == NULL && _PyOS_optind < argc &&
+ wcscmp(argv[_PyOS_optind], L"-") != 0)
+ {
- filename = argv[_PyOS_optind];
+ if (target_script_name != NULL && *target_script_name != '\0') {
+ size_t length = strlen(target_script_name);
@@ -33,12 +33,12 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
+ }
+ if (filename == NULL)
+ filename = argv[_PyOS_optind];
- #endif
}
+ stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
--- Modules/posixmodule.c
+++ Modules/posixmodule.c
-@@ -1157,6 +1157,10 @@
+@@ -1239,6 +1239,10 @@
char *p = strchr(*e, '=');
if (p == NULL)
continue;
@@ -66,38 +66,40 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
#ifdef MS_WINDOWS
int
wmain(int argc, wchar_t **argv)
-@@ -18,6 +26,11 @@
- int
- main(int argc, char **argv)
- {
+@@ -44,6 +52,11 @@
+ fpsetmask(m & ~FP_X_OFL);
+ #endif
+
+ if (getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION")) {
+ printf("GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n");
+ return 0;
+ }
+
- wchar_t **argv_copy;
- /* We need a second copy, as Python might modify the first one. */
- wchar_t **argv_copy2;
-@@ -59,6 +72,16 @@
+ oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
+ if (!oldloc) {
+ fprintf(stderr, "out of memory\n");
+@@ -66,6 +79,18 @@
setlocale(LC_ALL, oldloc);
- free(oldloc);
+ PyMem_RawFree(oldloc);
+
+#ifdef __linux__
-+ char *process_name = getenv("GENTOO_PYTHON_PROCESS_NAME");
++ {
++ char *process_name = getenv("GENTOO_PYTHON_PROCESS_NAME");
+#ifdef HAVE_UNSETENV
-+ unsetenv("GENTOO_PYTHON_PROCESS_NAME");
++ unsetenv("GENTOO_PYTHON_PROCESS_NAME");
+#endif
-+ if (process_name != NULL && *process_name != '\0')
-+ prctl(PR_SET_NAME, process_name);
++ if (process_name != NULL && *process_name != '\0')
++ prctl(PR_SET_NAME, process_name);
++ }
+#endif
+
res = Py_Main(argc, argv_copy);
for (i = 0; i < argc; i++) {
- PyMem_Free(argv_copy2[i]);
+ PyMem_RawFree(argv_copy2[i]);
--- Python/sysmodule.c
+++ Python/sysmodule.c
-@@ -1778,6 +1778,10 @@
+@@ -1852,6 +1852,10 @@
makeargvobject(int argc, wchar_t **argv)
{
PyObject *av;
@@ -108,10 +110,10 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
if (argc <= 0 || argv == NULL) {
/* Ensure at least one (empty) argument is seen */
static wchar_t *empty_argv[1] = {L""};
-@@ -1802,7 +1806,16 @@
- } else
- v = PyUnicode_FromString(argv[i]);
- #else
+@@ -1862,7 +1866,16 @@
+ if (av != NULL) {
+ int i;
+ for (i = 0; i < argc; i++) {
- PyObject *v = PyUnicode_FromWideChar(argv[i], -1);
+ PyObject *v = NULL;
+ if (i == 0 && wrapper_script_name != NULL && *wrapper_script_name != '\0') {
@@ -123,24 +125,29 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
+ }
+ if (v == NULL)
+ v = PyUnicode_FromWideChar(argv[i], -1);
- #endif
if (v == NULL) {
Py_DECREF(av);
-@@ -1822,7 +1835,12 @@
+ av = NULL;
+@@ -1881,7 +1894,9 @@
static void
sys_update_path(int argc, wchar_t **argv)
{
- wchar_t *argv0;
+ char *target_script_name = getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
-+#ifdef HAVE_UNSETENV
-+ unsetenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
-+#endif
+ wchar_t *wcs_target_script_name = NULL;
+ wchar_t *argv0 = NULL;
wchar_t *p = NULL;
Py_ssize_t n = 0;
PyObject *a;
-@@ -1842,7 +1860,14 @@
+@@ -1896,12 +1911,22 @@
+ #elif defined(MS_WINDOWS) && !defined(MS_WINCE)
+ wchar_t fullpath[MAX_PATH];
+ #endif
++#ifdef HAVE_UNSETENV
++ unsetenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
++#endif
+
+ path = _PySys_GetObjectId(&PyId_path);
if (path == NULL)
return;
@@ -156,7 +163,7 @@ python_generate_wrapper_scripts() to check if Python supports GENTOO_PYTHON_TARG
#ifdef HAVE_READLINK
if (_HAVE_SCRIPT_ARGUMENT(argc, argv))
-@@ -1919,6 +1944,7 @@
+@@ -1978,6 +2003,7 @@
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);