├── .cirrus.yml ├── 00001-rpath.patch ├── 00102-lib64.patch ├── 00111-no-static-lib.patch ├── 00132-add-rpmbuild-hooks-to-unittest.patch ├── 00155-avoid-ctypes-thunks.patch ├── 00160-disable-test_fs_holes-in-rpm-build.patch ├── 00163-disable-parts-of-test_socket-in-rpm-build.patch ├── 00170-gc-assertions.patch ├── 00178-dont-duplicate-flags-in-sysconfig.patch ├── 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch ├── 00196-test-gdb-match-addr-before-builtin.patch ├── 00205-make-libpl-respect-lib64.patch ├── 00251-change-user-install-location.patch ├── 00262-pep538_coerce_legacy_c_locale.patch ├── 00274-fix-arch-names.patch ├── 00292-restore-PyExc_RecursionErrorInst-symbol.patch ├── 00294-define-TLS-cipher-suite-on-build-time.patch ├── 00316-mark-bdist_wininst-unsupported.patch ├── 00317-CVE-2019-5010.patch ├── 00320-CVE-2019-9636-and-CVE-2019-10160.patch ├── 00324-disallow-control-chars-in-http-urls.patch ├── 00325-CVE-2019-9948.patch ├── check-pyc-and-pyo-timestamps.py ├── idle3.appdata.xml ├── idle3.desktop ├── python36.spec └── temporarily-disable-tests-requiring-SIGHUP.patch /.cirrus.yml: -------------------------------------------------------------------------------- 1 | task: 2 | only_if: $CIRRUS_TAG == '' 3 | env: 4 | matrix: 5 | - RELEASEVER: 6 6 | - RELEASEVER: 7 7 | name: el$RELEASEVER 8 | container: 9 | image: centos:$RELEASEVER 10 | cpu: 4 11 | timeout_in: 120m 12 | macros_script: | 13 | cat > $HOME/.rpmmacros << EOF 14 | %_sourcedir $PWD 15 | %_specdir $PWD 16 | %dist .el$RELEASEVER.ius 17 | %vendor IUS 18 | EOF 19 | epel_script: yum --assumeyes install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E %rhel).noarch.rpm 20 | toolchain_script: yum --assumeyes install yum-utils rpmdevtools @buildsys-build 21 | sources_script: spectool --get-files $CIRRUS_REPO_NAME.spec 22 | srpm_script: rpmbuild -bs $CIRRUS_REPO_NAME.spec 23 | builddep_script: yum-builddep --assumeyes $HOME/rpmbuild/SRPMS/$CIRRUS_REPO_NAME-*.src.rpm 24 | rpm_script: rpmbuild -bb $CIRRUS_REPO_NAME.spec 25 | gather_script: 26 | - mv --verbose $HOME/rpmbuild/SRPMS/*.src.rpm . 27 | - mv --verbose $HOME/rpmbuild/RPMS/*/*.rpm . 28 | results_artifacts: 29 | path: '*.rpm' 30 | -------------------------------------------------------------------------------- /00001-rpath.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py 2 | --- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath 2009-09-04 17:29:34.000000000 -0400 3 | +++ Python-3.1.1/Lib/distutils/unixccompiler.py 2009-09-04 17:49:54.000000000 -0400 4 | @@ -141,6 +141,15 @@ class UnixCCompiler(CCompiler): 5 | if sys.platform == "cygwin": 6 | exe_extension = ".exe" 7 | 8 | + def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs): 9 | + """Remove standard library path from rpath""" 10 | + libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args( 11 | + libraries, library_dirs, runtime_library_dirs) 12 | + libdir = sysconfig.get_config_var('LIBDIR') 13 | + if runtime_library_dirs and (libdir in runtime_library_dirs): 14 | + runtime_library_dirs.remove(libdir) 15 | + return libraries, library_dirs, runtime_library_dirs 16 | + 17 | def preprocess(self, source, output_file=None, macros=None, 18 | include_dirs=None, extra_preargs=None, extra_postargs=None): 19 | fixed_args = self._fix_compile_args(None, macros, include_dirs) 20 | -------------------------------------------------------------------------------- /00102-lib64.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py 2 | index 9474e9c..c0ce4c6 100644 3 | --- a/Lib/distutils/command/install.py 4 | +++ b/Lib/distutils/command/install.py 5 | @@ -30,14 +30,14 @@ WINDOWS_SCHEME = { 6 | INSTALL_SCHEMES = { 7 | 'unix_prefix': { 8 | 'purelib': '$base/lib/python$py_version_short/site-packages', 9 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', 10 | + 'platlib': '$platbase/lib64/python$py_version_short/site-packages', 11 | 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 12 | 'scripts': '$base/bin', 13 | 'data' : '$base', 14 | }, 15 | 'unix_home': { 16 | 'purelib': '$base/lib/python', 17 | - 'platlib': '$base/lib/python', 18 | + 'platlib': '$base/lib64/python', 19 | 'headers': '$base/include/python/$dist_name', 20 | 'scripts': '$base/bin', 21 | 'data' : '$base', 22 | diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py 23 | index 026cca7..6d3e077 100644 24 | --- a/Lib/distutils/sysconfig.py 25 | +++ b/Lib/distutils/sysconfig.py 26 | @@ -132,8 +132,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): 27 | prefix = plat_specific and EXEC_PREFIX or PREFIX 28 | 29 | if os.name == "posix": 30 | + if plat_specific or standard_lib: 31 | + lib = "lib64" 32 | + else: 33 | + lib = "lib" 34 | libpython = os.path.join(prefix, 35 | - "lib", "python" + get_python_version()) 36 | + lib, "python" + get_python_version()) 37 | if standard_lib: 38 | return libpython 39 | else: 40 | diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py 41 | --- a/Lib/distutils/tests/test_install.py 42 | +++ b/Lib/distutils/tests/test_install.py 43 | @@ -57,8 +57,9 @@ 44 | self.assertEqual(got, expected) 45 | 46 | libdir = os.path.join(destination, "lib", "python") 47 | + platlibdir = os.path.join(destination, "lib64", "python") 48 | check_path(cmd.install_lib, libdir) 49 | - check_path(cmd.install_platlib, libdir) 50 | + check_path(cmd.install_platlib, platlibdir) 51 | check_path(cmd.install_purelib, libdir) 52 | check_path(cmd.install_headers, 53 | os.path.join(destination, "include", "python", "foopkg")) 54 | diff --git a/Lib/site.py b/Lib/site.py 55 | index a84e3bb..ba0d3ea 100644 56 | --- a/Lib/site.py 57 | +++ b/Lib/site.py 58 | @@ -303,11 +303,15 @@ def getsitepackages(prefixes=None): 59 | seen.add(prefix) 60 | 61 | if os.sep == '/': 62 | + sitepackages.append(os.path.join(prefix, "lib64", 63 | + "python" + sys.version[:3], 64 | + "site-packages")) 65 | sitepackages.append(os.path.join(prefix, "lib", 66 | "python%d.%d" % sys.version_info[:2], 67 | "site-packages")) 68 | else: 69 | sitepackages.append(prefix) 70 | + sitepackages.append(os.path.join(prefix, "lib64", "site-packages")) 71 | sitepackages.append(os.path.join(prefix, "lib", "site-packages")) 72 | if sys.platform == "darwin": 73 | # for framework builds *only* we add the standard Apple 74 | diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py 75 | index b9bbfe5..2a5f29c 100644 76 | --- a/Lib/sysconfig.py 77 | +++ b/Lib/sysconfig.py 78 | @@ -20,10 +20,10 @@ __all__ = [ 79 | 80 | _INSTALL_SCHEMES = { 81 | 'posix_prefix': { 82 | - 'stdlib': '{installed_base}/lib/python{py_version_short}', 83 | - 'platstdlib': '{platbase}/lib/python{py_version_short}', 84 | + 'stdlib': '{installed_base}/lib64/python{py_version_short}', 85 | + 'platstdlib': '{platbase}/lib64/python{py_version_short}', 86 | 'purelib': '{base}/lib/python{py_version_short}/site-packages', 87 | - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', 88 | + 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages', 89 | 'include': 90 | '{installed_base}/include/python{py_version_short}{abiflags}', 91 | 'platinclude': 92 | @@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { 93 | 'data': '{userbase}', 94 | }, 95 | 'posix_user': { 96 | - 'stdlib': '{userbase}/lib/python{py_version_short}', 97 | - 'platstdlib': '{userbase}/lib/python{py_version_short}', 98 | + 'stdlib': '{userbase}/lib64/python{py_version_short}', 99 | + 'platstdlib': '{userbase}/lib64/python{py_version_short}', 100 | 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', 101 | - 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', 102 | + 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages', 103 | 'include': '{userbase}/include/python{py_version_short}', 104 | 'scripts': '{userbase}/bin', 105 | 'data': '{userbase}', 106 | diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py 107 | index f698927..bc977b5 100644 108 | --- a/Lib/test/test_site.py 109 | +++ b/Lib/test/test_site.py 110 | @@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): 111 | self.assertEqual(dirs[1], wanted) 112 | elif os.sep == '/': 113 | # OS X non-framework builds, Linux, FreeBSD, etc 114 | - self.assertEqual(len(dirs), 1) 115 | - wanted = os.path.join('xoxo', 'lib', 116 | + self.assertEqual(len(dirs), 2) 117 | + wanted = os.path.join('xoxo', 'lib64', 118 | 'python%d.%d' % sys.version_info[:2], 119 | 'site-packages') 120 | self.assertEqual(dirs[0], wanted) 121 | diff --git a/Makefile.pre.in b/Makefile.pre.in 122 | index 8fa7934..a693917 100644 123 | --- a/Makefile.pre.in 124 | +++ b/Makefile.pre.in 125 | @@ -126,7 +126,7 @@ LIBDIR= @libdir@ 126 | MANDIR= @mandir@ 127 | INCLUDEDIR= @includedir@ 128 | CONFINCLUDEDIR= $(exec_prefix)/include 129 | -SCRIPTDIR= $(prefix)/lib 130 | +SCRIPTDIR= $(prefix)/lib64 131 | ABIFLAGS= @ABIFLAGS@ 132 | 133 | # Detailed destination directories 134 | diff --git a/Modules/getpath.c b/Modules/getpath.c 135 | index 65b47a3..eaa756c 100644 136 | --- a/Modules/getpath.c 137 | +++ b/Modules/getpath.c 138 | @@ -494,7 +494,7 @@ calculate_path(void) 139 | _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); 140 | _prefix = Py_DecodeLocale(PREFIX, NULL); 141 | _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); 142 | - lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); 143 | + lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL); 144 | 145 | if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { 146 | Py_FatalError( 147 | @@ -683,7 +683,7 @@ calculate_path(void) 148 | } 149 | else 150 | wcsncpy(zip_path, _prefix, MAXPATHLEN); 151 | - joinpath(zip_path, L"lib/python00.zip"); 152 | + joinpath(zip_path, L"lib64/python00.zip"); 153 | bufsz = wcslen(zip_path); /* Replace "00" with version */ 154 | zip_path[bufsz - 6] = VERSION[0]; 155 | zip_path[bufsz - 5] = VERSION[2]; 156 | @@ -695,7 +695,7 @@ calculate_path(void) 157 | fprintf(stderr, 158 | "Could not find platform dependent libraries \n"); 159 | wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); 160 | - joinpath(exec_prefix, L"lib/lib-dynload"); 161 | + joinpath(exec_prefix, L"lib64/lib-dynload"); 162 | } 163 | /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ 164 | 165 | diff --git a/setup.py b/setup.py 166 | index 0f2dfc4..da37896 100644 167 | --- a/setup.py 168 | +++ b/setup.py 169 | @@ -492,7 +492,7 @@ class PyBuildExt(build_ext): 170 | # directories (i.e. '.' and 'Include') must be first. See issue 171 | # 10520. 172 | if not cross_compiling: 173 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 174 | + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64') 175 | add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 176 | # only change this for cross builds for 3.3, issues on Mageia 177 | if cross_compiling: 178 | @@ -780,11 +780,11 @@ class PyBuildExt(build_ext): 179 | elif curses_library: 180 | readline_libs.append(curses_library) 181 | elif self.compiler.find_library_file(lib_dirs + 182 | - ['/usr/lib/termcap'], 183 | + ['/usr/lib64/termcap'], 184 | 'termcap'): 185 | readline_libs.append('termcap') 186 | exts.append( Extension('readline', ['readline.c'], 187 | - library_dirs=['/usr/lib/termcap'], 188 | + library_dirs=['/usr/lib64/termcap'], 189 | extra_link_args=readline_extra_link_args, 190 | libraries=readline_libs) ) 191 | else: 192 | @@ -821,8 +821,8 @@ class PyBuildExt(build_ext): 193 | if krb5_h: 194 | ssl_incs += krb5_h 195 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, 196 | - ['/usr/local/ssl/lib', 197 | - '/usr/contrib/ssl/lib/' 198 | + ['/usr/local/ssl/lib64', 199 | + '/usr/contrib/ssl/lib64/' 200 | ] ) 201 | 202 | if (ssl_incs is not None and 203 | -------------------------------------------------------------------------------- /00111-no-static-lib.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile.pre.in b/Makefile.pre.in 2 | index 9cd482f..b074b26 100644 3 | --- a/Makefile.pre.in 4 | +++ b/Makefile.pre.in 5 | @@ -549,7 +549,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c 6 | $(PYTHON_FOR_REGEN) ./Tools/clinic/clinic.py --make 7 | 8 | # Build the interpreter 9 | -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) 10 | +$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) 11 | $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) 12 | 13 | platform: $(BUILDPYTHON) pybuilddir.txt 14 | @@ -597,12 +597,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o 15 | _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ 16 | $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build 17 | 18 | - 19 | -# Build static library 20 | -$(LIBRARY): $(LIBRARY_OBJS) 21 | - -rm -f $@ 22 | - $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) 23 | - 24 | libpython$(LDVERSION).so: $(LIBRARY_OBJS) 25 | if test $(INSTSONAME) != $(LDLIBRARY); then \ 26 | $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ 27 | @@ -692,7 +686,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist 28 | echo "-----------------------------------------------"; \ 29 | fi 30 | 31 | -Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) 32 | +Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) 33 | $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) 34 | 35 | ############################################################################ 36 | @@ -1428,17 +1422,6 @@ libainstall: @DEF_MAKE_RULE@ python-config 37 | else true; \ 38 | fi; \ 39 | done 40 | - @if test -d $(LIBRARY); then :; else \ 41 | - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ 42 | - if test "$(SHLIB_SUFFIX)" = .dll; then \ 43 | - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ 44 | - else \ 45 | - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ 46 | - fi; \ 47 | - else \ 48 | - echo Skip install of $(LIBRARY) - use make frameworkinstall; \ 49 | - fi; \ 50 | - fi 51 | $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c 52 | $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o 53 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in 54 | -------------------------------------------------------------------------------- /00132-add-rpmbuild-hooks-to-unittest.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/case.py 2 | --- Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest 2011-09-03 12:16:44.000000000 -0400 3 | +++ Python-3.2.2/Lib/unittest/case.py 2011-09-09 06:35:16.365568382 -0400 4 | @@ -3,6 +3,7 @@ 5 | import sys 6 | import functools 7 | import difflib 8 | +import os 9 | import logging 10 | import pprint 11 | import re 12 | @@ -101,5 +102,21 @@ def expectedFailure(func): 13 | raise self.test_case.failureException(msg) 14 | 15 | +# Non-standard/downstream-only hooks for handling issues with specific test 16 | +# cases: 17 | + 18 | +def _skipInRpmBuild(reason): 19 | + """ 20 | + Non-standard/downstream-only decorator for marking a specific unit test 21 | + to be skipped when run within the %check of an rpmbuild. 22 | + 23 | + Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within 24 | + the environment, and has no effect otherwise. 25 | + """ 26 | + if 'WITHIN_PYTHON_RPM_BUILD' in os.environ: 27 | + return skip(reason) 28 | + else: 29 | + return _id 30 | + 31 | class _AssertRaisesBaseContext(_BaseTestCaseContext): 32 | 33 | def __init__(self, expected, test_case, expected_regex=None): 34 | diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/__init__.py 35 | --- Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest 2011-09-03 12:16:44.000000000 -0400 36 | +++ Python-3.2.2/Lib/unittest/__init__.py 2011-09-09 06:35:16.366568382 -0400 37 | @@ -57,7 +57,8 @@ __unittest = True 38 | 39 | from .result import TestResult 40 | from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, 41 | - skipUnless, expectedFailure) 42 | + skipUnless, expectedFailure, 43 | + _skipInRpmBuild) 44 | from .suite import BaseTestSuite, TestSuite 45 | from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, 46 | findTestCases) 47 | -------------------------------------------------------------------------------- /00155-avoid-ctypes-thunks.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.2.3/Lib/ctypes/__init__.py.rhbz814391 Python-3.2.3/Lib/ctypes/__init__.py 2 | --- Python-3.2.3/Lib/ctypes/__init__.py.rhbz814391 2012-04-20 15:12:49.017867692 -0400 3 | +++ Python-3.2.3/Lib/ctypes/__init__.py 2012-04-20 15:15:09.501111408 -0400 4 | @@ -275,11 +275,6 @@ def _reset_cache(): 5 | # _SimpleCData.c_char_p_from_param 6 | POINTER(c_char).from_param = c_char_p.from_param 7 | _pointer_type_cache[None] = c_void_p 8 | - # XXX for whatever reasons, creating the first instance of a callback 9 | - # function is needed for the unittests on Win64 to succeed. This MAY 10 | - # be a compiler bug, since the problem occurs only when _ctypes is 11 | - # compiled with the MS SDK compiler. Or an uninitialized variable? 12 | - CFUNCTYPE(c_int)(lambda: None) 13 | 14 | def create_unicode_buffer(init, size=None): 15 | """create_unicode_buffer(aString) -> character array 16 | -------------------------------------------------------------------------------- /00160-disable-test_fs_holes-in-rpm-build.patch: -------------------------------------------------------------------------------- 1 | diff -up cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build cpython-59223da36dec/Lib/test/test_posix.py 2 | --- cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build 2012-08-07 17:15:59.000000000 -0400 3 | +++ cpython-59223da36dec/Lib/test/test_posix.py 2012-08-07 17:16:53.528330330 -0400 4 | @@ -973,6 +973,7 @@ class PosixTester(unittest.TestCase): 5 | posix.RTLD_GLOBAL 6 | posix.RTLD_LOCAL 7 | 8 | + @unittest._skipInRpmBuild('running kernel may not match kernel in chroot') 9 | @unittest.skipUnless(hasattr(os, 'SEEK_HOLE'), 10 | "test needs an OS that reports file holes") 11 | def test_fs_holes(self): 12 | -------------------------------------------------------------------------------- /00163-disable-parts-of-test_socket-in-rpm-build.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds Python-3.3.0b1/Lib/test/test_socket.py 2 | --- Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds 2012-07-24 15:02:30.823355067 -0400 3 | +++ Python-3.3.0b1/Lib/test/test_socket.py 2012-07-24 15:08:13.021354999 -0400 4 | @@ -2188,6 +2188,7 @@ class RecvmsgGenericStreamTests(RecvmsgG 5 | # Tests which require a stream socket and can use either recvmsg() 6 | # or recvmsg_into(). 7 | 8 | + @unittest._skipInRpmBuild('fails intermittently when run within Koji') 9 | def testRecvmsgEOF(self): 10 | # Receive end-of-stream indicator (b"", peer socket closed). 11 | msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, 1024) 12 | -------------------------------------------------------------------------------- /00170-gc-assertions.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Include/object.h b/Include/object.h 2 | index 63e37b8..613b26c 100644 3 | --- a/Include/object.h 4 | +++ b/Include/object.h 5 | @@ -1071,6 +1071,49 @@ PyAPI_FUNC(void) 6 | _PyObject_DebugTypeStats(FILE *out); 7 | #endif /* ifndef Py_LIMITED_API */ 8 | 9 | +/* 10 | + Define a pair of assertion macros. 11 | + 12 | + These work like the regular C assert(), in that they will abort the 13 | + process with a message on stderr if the given condition fails to hold, 14 | + but compile away to nothing if NDEBUG is defined. 15 | + 16 | + However, before aborting, Python will also try to call _PyObject_Dump() on 17 | + the given object. This may be of use when investigating bugs in which a 18 | + particular object is corrupt (e.g. buggy a tp_visit method in an extension 19 | + module breaking the garbage collector), to help locate the broken objects. 20 | + 21 | + The WITH_MSG variant allows you to supply an additional message that Python 22 | + will attempt to print to stderr, after the object dump. 23 | +*/ 24 | +#ifdef NDEBUG 25 | +/* No debugging: compile away the assertions: */ 26 | +#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0) 27 | +#else 28 | +/* With debugging: generate checks: */ 29 | +#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ 30 | + ((expr) \ 31 | + ? (void)(0) \ 32 | + : _PyObject_AssertFailed((obj), \ 33 | + (msg), \ 34 | + (__STRING(expr)), \ 35 | + (__FILE__), \ 36 | + (__LINE__), \ 37 | + (__PRETTY_FUNCTION__))) 38 | +#endif 39 | + 40 | +#define PyObject_ASSERT(obj, expr) \ 41 | + PyObject_ASSERT_WITH_MSG(obj, expr, NULL) 42 | + 43 | +/* 44 | + Declare and define the entrypoint even when NDEBUG is defined, to avoid 45 | + causing compiler/linker errors when building extensions without NDEBUG 46 | + against a Python built with NDEBUG defined 47 | +*/ 48 | +PyAPI_FUNC(void) _PyObject_AssertFailed(PyObject *, const char *, 49 | + const char *, const char *, int, 50 | + const char *); 51 | + 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py 56 | index 7e82b24..4497b8f 100644 57 | --- a/Lib/test/test_gc.py 58 | +++ b/Lib/test/test_gc.py 59 | @@ -1,10 +1,12 @@ 60 | import unittest 61 | from test.support import (verbose, refcount_test, run_unittest, 62 | strip_python_stderr, cpython_only, start_threads, 63 | - temp_dir, requires_type_collecting, TESTFN, unlink) 64 | + temp_dir, requires_type_collecting, TESTFN, unlink, 65 | + import_module) 66 | from test.support.script_helper import assert_python_ok, make_script 67 | 68 | import sys 69 | +import sysconfig 70 | import time 71 | import gc 72 | import weakref 73 | @@ -50,6 +52,8 @@ class GC_Detector(object): 74 | # gc collects it. 75 | self.wr = weakref.ref(C1055820(666), it_happened) 76 | 77 | +BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS']) 78 | + 79 | @with_tp_del 80 | class Uncollectable(object): 81 | """Create a reference cycle with multiple __del__ methods. 82 | @@ -877,6 +881,50 @@ class GCCallbackTests(unittest.TestCase): 83 | self.assertEqual(len(gc.garbage), 0) 84 | 85 | 86 | + @unittest.skipIf(BUILD_WITH_NDEBUG, 87 | + 'built with -NDEBUG') 88 | + def test_refcount_errors(self): 89 | + self.preclean() 90 | + # Verify the "handling" of objects with broken refcounts 91 | + import_module("ctypes") #skip if not supported 92 | + 93 | + import subprocess 94 | + code = '''if 1: 95 | + a = [] 96 | + b = [a] 97 | + 98 | + # Simulate the refcount of "a" being too low (compared to the 99 | + # references held on it by live data), but keeping it above zero 100 | + # (to avoid deallocating it): 101 | + import ctypes 102 | + ctypes.pythonapi.Py_DecRef(ctypes.py_object(a)) 103 | + 104 | + # The garbage collector should now have a fatal error when it reaches 105 | + # the broken object: 106 | + import gc 107 | + gc.collect() 108 | + ''' 109 | + p = subprocess.Popen([sys.executable, "-c", code], 110 | + stdout=subprocess.PIPE, 111 | + stderr=subprocess.PIPE) 112 | + stdout, stderr = p.communicate() 113 | + p.stdout.close() 114 | + p.stderr.close() 115 | + # Verify that stderr has a useful error message: 116 | + self.assertRegex(stderr, 117 | + b'Modules/gcmodule.c:[0-9]+: visit_decref: Assertion "\(\(gc\)->gc.gc_refs >> \(1\)\) != 0" failed.') 118 | + self.assertRegex(stderr, 119 | + b'refcount was too small') 120 | + self.assertRegex(stderr, 121 | + b'object : \[\]') 122 | + self.assertRegex(stderr, 123 | + b'type : list') 124 | + self.assertRegex(stderr, 125 | + b'refcount: 1') 126 | + self.assertRegex(stderr, 127 | + b'address : 0x[0-9a-f]+') 128 | + 129 | + 130 | class GCTogglingTests(unittest.TestCase): 131 | def setUp(self): 132 | gc.enable() 133 | diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c 134 | index 3bddc40..0cc24f7 100644 135 | --- a/Modules/gcmodule.c 136 | +++ b/Modules/gcmodule.c 137 | @@ -342,7 +342,8 @@ update_refs(PyGC_Head *containers) 138 | { 139 | PyGC_Head *gc = containers->gc.gc_next; 140 | for (; gc != containers; gc = gc->gc.gc_next) { 141 | - assert(_PyGCHead_REFS(gc) == GC_REACHABLE); 142 | + PyObject_ASSERT(FROM_GC(gc), 143 | + _PyGCHead_REFS(gc) == GC_REACHABLE); 144 | _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); 145 | /* Python's cyclic gc should never see an incoming refcount 146 | * of 0: if something decref'ed to 0, it should have been 147 | @@ -362,7 +363,8 @@ update_refs(PyGC_Head *containers) 148 | * so serious that maybe this should be a release-build 149 | * check instead of an assert? 150 | */ 151 | - assert(_PyGCHead_REFS(gc) != 0); 152 | + PyObject_ASSERT(FROM_GC(gc), 153 | + _PyGCHead_REFS(gc) != 0); 154 | } 155 | } 156 | 157 | @@ -377,7 +379,9 @@ visit_decref(PyObject *op, void *data) 158 | * generation being collected, which can be recognized 159 | * because only they have positive gc_refs. 160 | */ 161 | - assert(_PyGCHead_REFS(gc) != 0); /* else refcount was too small */ 162 | + PyObject_ASSERT_WITH_MSG(FROM_GC(gc), 163 | + _PyGCHead_REFS(gc) != 0, 164 | + "refcount was too small"); /* else refcount was too small */ 165 | if (_PyGCHead_REFS(gc) > 0) 166 | _PyGCHead_DECREF(gc); 167 | } 168 | @@ -437,9 +441,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) 169 | * If gc_refs == GC_UNTRACKED, it must be ignored. 170 | */ 171 | else { 172 | - assert(gc_refs > 0 173 | - || gc_refs == GC_REACHABLE 174 | - || gc_refs == GC_UNTRACKED); 175 | + PyObject_ASSERT(FROM_GC(gc), 176 | + gc_refs > 0 177 | + || gc_refs == GC_REACHABLE 178 | + || gc_refs == GC_UNTRACKED); 179 | } 180 | } 181 | return 0; 182 | @@ -481,7 +486,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) 183 | */ 184 | PyObject *op = FROM_GC(gc); 185 | traverseproc traverse = Py_TYPE(op)->tp_traverse; 186 | - assert(_PyGCHead_REFS(gc) > 0); 187 | + PyObject_ASSERT(op, _PyGCHead_REFS(gc) > 0); 188 | _PyGCHead_SET_REFS(gc, GC_REACHABLE); 189 | (void) traverse(op, 190 | (visitproc)visit_reachable, 191 | @@ -544,7 +549,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) 192 | for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { 193 | PyObject *op = FROM_GC(gc); 194 | 195 | - assert(IS_TENTATIVELY_UNREACHABLE(op)); 196 | + PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op)); 197 | next = gc->gc.gc_next; 198 | 199 | if (has_legacy_finalizer(op)) { 200 | @@ -620,7 +625,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) 201 | PyWeakReference **wrlist; 202 | 203 | op = FROM_GC(gc); 204 | - assert(IS_TENTATIVELY_UNREACHABLE(op)); 205 | + PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op)); 206 | next = gc->gc.gc_next; 207 | 208 | if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) 209 | @@ -641,9 +646,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) 210 | * the callback pointer intact. Obscure: it also 211 | * changes *wrlist. 212 | */ 213 | - assert(wr->wr_object == op); 214 | + PyObject_ASSERT(wr->wr_object, wr->wr_object == op); 215 | _PyWeakref_ClearRef(wr); 216 | - assert(wr->wr_object == Py_None); 217 | + PyObject_ASSERT(wr->wr_object, wr->wr_object == Py_None); 218 | if (wr->wr_callback == NULL) 219 | continue; /* no callback */ 220 | 221 | @@ -677,7 +682,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) 222 | */ 223 | if (IS_TENTATIVELY_UNREACHABLE(wr)) 224 | continue; 225 | - assert(IS_REACHABLE(wr)); 226 | + PyObject_ASSERT(op, IS_REACHABLE(wr)); 227 | 228 | /* Create a new reference so that wr can't go away 229 | * before we can process it again. 230 | @@ -686,7 +691,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) 231 | 232 | /* Move wr to wrcb_to_call, for the next pass. */ 233 | wrasgc = AS_GC(wr); 234 | - assert(wrasgc != next); /* wrasgc is reachable, but 235 | + PyObject_ASSERT(op, wrasgc != next); 236 | + /* wrasgc is reachable, but 237 | next isn't, so they can't 238 | be the same */ 239 | gc_list_move(wrasgc, &wrcb_to_call); 240 | @@ -702,11 +708,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) 241 | 242 | gc = wrcb_to_call.gc.gc_next; 243 | op = FROM_GC(gc); 244 | - assert(IS_REACHABLE(op)); 245 | - assert(PyWeakref_Check(op)); 246 | + PyObject_ASSERT(op, IS_REACHABLE(op)); 247 | + PyObject_ASSERT(op, PyWeakref_Check(op)); 248 | wr = (PyWeakReference *)op; 249 | callback = wr->wr_callback; 250 | - assert(callback != NULL); 251 | + PyObject_ASSERT(op, callback != NULL); 252 | 253 | /* copy-paste of weakrefobject.c's handle_callback() */ 254 | temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); 255 | @@ -820,12 +826,14 @@ check_garbage(PyGC_Head *collectable) 256 | for (gc = collectable->gc.gc_next; gc != collectable; 257 | gc = gc->gc.gc_next) { 258 | _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); 259 | - assert(_PyGCHead_REFS(gc) != 0); 260 | + PyObject_ASSERT(FROM_GC(gc), 261 | + _PyGCHead_REFS(gc) != 0); 262 | } 263 | subtract_refs(collectable); 264 | for (gc = collectable->gc.gc_next; gc != collectable; 265 | gc = gc->gc.gc_next) { 266 | - assert(_PyGCHead_REFS(gc) >= 0); 267 | + PyObject_ASSERT(FROM_GC(gc), 268 | + _PyGCHead_REFS(gc) >= 0); 269 | if (_PyGCHead_REFS(gc) != 0) 270 | return -1; 271 | } 272 | diff --git a/Objects/object.c b/Objects/object.c 273 | index defff55..a50697d 100644 274 | --- a/Objects/object.c 275 | +++ b/Objects/object.c 276 | @@ -2030,6 +2030,35 @@ _PyTrash_thread_destroy_chain(void) 277 | } 278 | } 279 | 280 | +PyAPI_FUNC(void) 281 | +_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr, 282 | + const char *file, int line, const char *function) 283 | +{ 284 | + fprintf(stderr, 285 | + "%s:%d: %s: Assertion \"%s\" failed.\n", 286 | + file, line, function, expr); 287 | + if (msg) { 288 | + fprintf(stderr, "%s\n", msg); 289 | + } 290 | + 291 | + fflush(stderr); 292 | + 293 | + if (obj) { 294 | + /* This might succeed or fail, but we're about to abort, so at least 295 | + try to provide any extra info we can: */ 296 | + _PyObject_Dump(obj); 297 | + } 298 | + else { 299 | + fprintf(stderr, "NULL object\n"); 300 | + } 301 | + 302 | + fflush(stdout); 303 | + fflush(stderr); 304 | + 305 | + /* Terminate the process: */ 306 | + abort(); 307 | +} 308 | + 309 | #ifndef Py_TRACE_REFS 310 | /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. 311 | Define this here, so we can undefine the macro. */ 312 | -------------------------------------------------------------------------------- /00178-dont-duplicate-flags-in-sysconfig.patch: -------------------------------------------------------------------------------- 1 | diff -r 39b9b05c3085 Lib/distutils/sysconfig.py 2 | --- a/Lib/distutils/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 3 | +++ b/Lib/distutils/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 4 | @@ -362,7 +362,10 @@ 5 | done[n] = item = "" 6 | if found: 7 | after = value[m.end():] 8 | - value = value[:m.start()] + item + after 9 | + value = value[:m.start()] 10 | + if item.strip() not in value: 11 | + value += item 12 | + value += after 13 | if "$" in after: 14 | notdone[name] = value 15 | else: 16 | diff -r 39b9b05c3085 Lib/sysconfig.py 17 | --- a/Lib/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 18 | +++ b/Lib/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 19 | @@ -296,7 +296,10 @@ 20 | 21 | if found: 22 | after = value[m.end():] 23 | - value = value[:m.start()] + item + after 24 | + value = value[:m.start()] 25 | + if item.strip() not in value: 26 | + value += item 27 | + value += after 28 | if "$" in after: 29 | notdone[name] = value 30 | else: 31 | -------------------------------------------------------------------------------- /00184-ctypes-should-build-with-libffi-multilib-wrapper.patch: -------------------------------------------------------------------------------- 1 | --- Python-3.3.2/setup.py.orig 2013-07-01 15:23:24.377711044 +0200 2 | +++ Python-3.3.2/setup.py 2013-07-01 15:23:34.094676496 +0200 3 | @@ -1882,7 +1882,8 @@ 4 | if not line: 5 | ffi_inc = None 6 | break 7 | - if line.startswith('#define LIBFFI_H'): 8 | + if line.startswith('#define LIBFFI_H') or \ 9 | + line.startswith('#define ffi_wrapper_h'): 10 | break 11 | ffi_lib = None 12 | if ffi_inc is not None: 13 | -------------------------------------------------------------------------------- /00196-test-gdb-match-addr-before-builtin.patch: -------------------------------------------------------------------------------- 1 | Subject: python3.test gdb match addr before builtin 2 | From: Michel Normand 3 | 4 | For ppc64le archi and python3... and gdb... versions 5 | the test_gdb.py need a change of re.match to handle address before the builtin_id word. 6 | Of course there is no error if this substring is not present. 7 | === 8 | ... 9 | #0 0x00003fffb7dd0898 in builtin_id (self=, v=) at /builddir/build/BUILD/Python-3.3.2/Python/bltinmodule.c:966 10 | ....xxxxxxxxxxxxxxxxxxxxxx <= added regexp 11 | === 12 | 13 | Signed-off-by: Michel Normand 14 | --- 15 | Lib/test/test_gdb.py | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | Index: Python-3.3.2/Lib/test/test_gdb.py 19 | =================================================================== 20 | --- Python-3.3.2.orig/Lib/test/test_gdb.py 21 | +++ Python-3.3.2/Lib/test/test_gdb.py 22 | @@ -230,7 +230,7 @@ class DebuggerTests(unittest.TestCase): 23 | # gdb can insert additional '\n' and space characters in various places 24 | # in its output, depending on the width of the terminal it's connected 25 | # to (using its "wrap_here" function) 26 | - m = re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*', 27 | + m = re.match('.*#0\s+(?: 0x[0-9a-f]+\s+in\s+)?builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*', 28 | gdb_output, re.DOTALL) 29 | if not m: 30 | self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output)) 31 | -------------------------------------------------------------------------------- /00205-make-libpl-respect-lib64.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in 2 | --- Python-3.5.0/Makefile.pre.in.lib 2015-09-21 15:39:47.928286620 +0200 3 | +++ Python-3.5.0/Makefile.pre.in 2015-09-21 15:42:58.004042762 +0200 4 | @@ -1340,7 +1340,7 @@ inclinstall: 5 | 6 | # Install the library and miscellaneous stuff needed for extending/embedding 7 | # This goes into $(exec_prefix) 8 | -LIBPL= @LIBPL@ 9 | +LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) 10 | 11 | # pkgconfig directory 12 | LIBPC= $(LIBDIR)/pkgconfig 13 | -------------------------------------------------------------------------------- /00251-change-user-install-location.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py 2 | index 0258d3d..4ebf50a 100644 3 | --- a/Lib/distutils/command/install.py 4 | +++ b/Lib/distutils/command/install.py 5 | @@ -418,8 +418,19 @@ class install(Command): 6 | raise DistutilsOptionError( 7 | "must not supply exec-prefix without prefix") 8 | 9 | - self.prefix = os.path.normpath(sys.prefix) 10 | - self.exec_prefix = os.path.normpath(sys.exec_prefix) 11 | + # self.prefix is set to sys.prefix + /local/ 12 | + # if neither RPM build nor virtual environment is 13 | + # detected to make pip and distutils install packages 14 | + # into the separate location. 15 | + if (not (hasattr(sys, 'real_prefix') or 16 | + sys.prefix != sys.base_prefix) and 17 | + 'RPM_BUILD_ROOT' not in os.environ): 18 | + addition = "/local" 19 | + else: 20 | + addition = "" 21 | + 22 | + self.prefix = os.path.normpath(sys.prefix) + addition 23 | + self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition 24 | 25 | else: 26 | if self.exec_prefix is None: 27 | diff --git a/Lib/site.py b/Lib/site.py 28 | index 0fc9200..c95202e 100644 29 | --- a/Lib/site.py 30 | +++ b/Lib/site.py 31 | @@ -322,7 +322,14 @@ def getsitepackages(prefixes=None): 32 | return sitepackages 33 | 34 | def addsitepackages(known_paths, prefixes=None): 35 | - """Add site-packages to sys.path""" 36 | + """Add site-packages to sys.path 37 | + 38 | + '/usr/local' is included in PREFIXES if RPM build is not detected 39 | + to make packages installed into this location visible. 40 | + 41 | + """ 42 | + if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ: 43 | + PREFIXES.insert(0, "/usr/local") 44 | for sitedir in getsitepackages(prefixes): 45 | if os.path.isdir(sitedir): 46 | addsitedir(sitedir, known_paths) 47 | -------------------------------------------------------------------------------- /00262-pep538_coerce_legacy_c_locale.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst 2 | index d14793a..65aa3ad 100644 3 | --- a/Doc/using/cmdline.rst 4 | +++ b/Doc/using/cmdline.rst 5 | @@ -728,6 +728,45 @@ conflict. 6 | 7 | .. versionadded:: 3.6 8 | 9 | + 10 | +.. envvar:: PYTHONCOERCECLOCALE 11 | + 12 | + If set to the value ``0``, causes the main Python command line application 13 | + to skip coercing the legacy ASCII-based C locale to a more capable UTF-8 14 | + based alternative. Note that this setting is checked even when the 15 | + :option:`-E` or :option:`-I` options are used, as it is handled prior to 16 | + the processing of command line options. 17 | + 18 | + If this variable is *not* set, or is set to a value other than ``0``, and 19 | + the current locale reported for the ``LC_CTYPE`` category is the default 20 | + ``C`` locale, then the Python CLI will attempt to configure one of the 21 | + following locales for the given locale categories before loading the 22 | + interpreter runtime: 23 | + 24 | + * ``C.UTF-8`` (``LC_ALL``) 25 | + * ``C.utf8`` (``LC_ALL``) 26 | + * ``UTF-8`` (``LC_CTYPE``) 27 | + 28 | + If setting one of these locale categories succeeds, then the matching 29 | + environment variables will be set (both ``LC_ALL`` and ``LANG`` for the 30 | + ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category) in 31 | + the current process environment before the Python runtime is initialized. 32 | + 33 | + Configuring one of these locales (either explicitly or via the above 34 | + implicit locale coercion) will automatically set the error handler for 35 | + :data:`sys.stdin` and :data:`sys.stdout` to ``surrogateescape``. This 36 | + behavior can be overridden using :envvar:`PYTHONIOENCODING` as usual. 37 | + 38 | + For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause 39 | + Python to emit warning messages on ``stderr`` if either the locale coercion 40 | + activates, or else if a locale that *would* have triggered coercion is 41 | + still active when the Python runtime is initialized. 42 | + 43 | + Availability: \*nix 44 | + 45 | + .. versionadded:: 3.7 46 | + See :pep:`538` for more details. 47 | + 48 | Debug-mode variables 49 | ~~~~~~~~~~~~~~~~~~~~ 50 | 51 | diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py 52 | index 507dc48..c3cb720 100644 53 | --- a/Lib/test/support/script_helper.py 54 | +++ b/Lib/test/support/script_helper.py 55 | @@ -56,8 +56,35 @@ def interpreter_requires_environment(): 56 | return __cached_interp_requires_environment 57 | 58 | 59 | -_PythonRunResult = collections.namedtuple("_PythonRunResult", 60 | - ("rc", "out", "err")) 61 | +class _PythonRunResult(collections.namedtuple("_PythonRunResult", 62 | + ("rc", "out", "err"))): 63 | + """Helper for reporting Python subprocess run results""" 64 | + def fail(self, cmd_line): 65 | + """Provide helpful details about failed subcommand runs""" 66 | + # Limit to 80 lines to ASCII characters 67 | + maxlen = 80 * 100 68 | + out, err = self.out, self.err 69 | + if len(out) > maxlen: 70 | + out = b'(... truncated stdout ...)' + out[-maxlen:] 71 | + if len(err) > maxlen: 72 | + err = b'(... truncated stderr ...)' + err[-maxlen:] 73 | + out = out.decode('ascii', 'replace').rstrip() 74 | + err = err.decode('ascii', 'replace').rstrip() 75 | + raise AssertionError("Process return code is %d\n" 76 | + "command line: %r\n" 77 | + "\n" 78 | + "stdout:\n" 79 | + "---\n" 80 | + "%s\n" 81 | + "---\n" 82 | + "\n" 83 | + "stderr:\n" 84 | + "---\n" 85 | + "%s\n" 86 | + "---" 87 | + % (self.rc, cmd_line, 88 | + out, 89 | + err)) 90 | 91 | 92 | # Executing the interpreter in a subprocess 93 | @@ -115,30 +142,7 @@ def run_python_until_end(*args, **env_vars): 94 | def _assert_python(expected_success, *args, **env_vars): 95 | res, cmd_line = run_python_until_end(*args, **env_vars) 96 | if (res.rc and expected_success) or (not res.rc and not expected_success): 97 | - # Limit to 80 lines to ASCII characters 98 | - maxlen = 80 * 100 99 | - out, err = res.out, res.err 100 | - if len(out) > maxlen: 101 | - out = b'(... truncated stdout ...)' + out[-maxlen:] 102 | - if len(err) > maxlen: 103 | - err = b'(... truncated stderr ...)' + err[-maxlen:] 104 | - out = out.decode('ascii', 'replace').rstrip() 105 | - err = err.decode('ascii', 'replace').rstrip() 106 | - raise AssertionError("Process return code is %d\n" 107 | - "command line: %r\n" 108 | - "\n" 109 | - "stdout:\n" 110 | - "---\n" 111 | - "%s\n" 112 | - "---\n" 113 | - "\n" 114 | - "stderr:\n" 115 | - "---\n" 116 | - "%s\n" 117 | - "---" 118 | - % (res.rc, cmd_line, 119 | - out, 120 | - err)) 121 | + res.fail(cmd_line) 122 | return res 123 | 124 | def assert_python_ok(*args, **env_vars): 125 | diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py 126 | new file mode 100644 127 | index 0000000..635c98f 128 | --- /dev/null 129 | +++ b/Lib/test/test_c_locale_coercion.py 130 | @@ -0,0 +1,371 @@ 131 | +# Tests the attempted automatic coercion of the C locale to a UTF-8 locale 132 | + 133 | +import unittest 134 | +import locale 135 | +import os 136 | +import sys 137 | +import sysconfig 138 | +import shutil 139 | +import subprocess 140 | +from collections import namedtuple 141 | + 142 | +import test.support 143 | +from test.support.script_helper import ( 144 | + run_python_until_end, 145 | + interpreter_requires_environment, 146 | +) 147 | + 148 | +# Set our expectation for the default encoding used in the C locale 149 | +# for the filesystem encoding and the standard streams 150 | + 151 | +# AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII 152 | +if sys.platform.startswith("aix"): 153 | + C_LOCALE_STREAM_ENCODING = "iso8859-1" 154 | +else: 155 | + C_LOCALE_STREAM_ENCODING = "ascii" 156 | + 157 | +# FS encoding is UTF-8 on macOS, other *nix platforms use the locale encoding 158 | +if sys.platform == "darwin": 159 | + C_LOCALE_FS_ENCODING = "utf-8" 160 | +else: 161 | + C_LOCALE_FS_ENCODING = C_LOCALE_STREAM_ENCODING 162 | + 163 | +# Note that the above is probably still wrong in some cases, such as: 164 | +# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set 165 | +# * AIX and any other platforms that use latin-1 in the C locale 166 | +# 167 | +# Options for dealing with this: 168 | +# * Don't set PYTHON_COERCE_C_LOCALE on such platforms (e.g. Windows doesn't) 169 | +# * Fix the test expectations to match the actual platform behaviour 170 | + 171 | +# In order to get the warning messages to match up as expected, the candidate 172 | +# order here must much the target locale order in Python/pylifecycle.c 173 | +_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8", "UTF-8") 174 | + 175 | +# There's no reliable cross-platform way of checking locale alias 176 | +# lists, so the only way of knowing which of these locales will work 177 | +# is to try them with locale.setlocale(). We do that in a subprocess 178 | +# to avoid altering the locale of the test runner. 179 | +# 180 | +# If the relevant locale module attributes exist, and we're not on a platform 181 | +# where we expect it to always succeed, we also check that 182 | +# `locale.nl_langinfo(locale.CODESET)` works, as if it fails, the interpreter 183 | +# will skip locale coercion for that particular target locale 184 | +_check_nl_langinfo_CODESET = bool( 185 | + sys.platform not in ("darwin", "linux") and 186 | + hasattr(locale, "nl_langinfo") and 187 | + hasattr(locale, "CODESET") 188 | +) 189 | + 190 | +def _set_locale_in_subprocess(locale_name): 191 | + cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))" 192 | + if _check_nl_langinfo_CODESET: 193 | + # If there's no valid CODESET, we expect coercion to be skipped 194 | + cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))" 195 | + cmd = cmd_fmt.format(locale_name) 196 | + result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) 197 | + return result.rc == 0 198 | + 199 | + 200 | + 201 | +_fields = "fsencoding stdin_info stdout_info stderr_info lang lc_ctype lc_all" 202 | +_EncodingDetails = namedtuple("EncodingDetails", _fields) 203 | + 204 | +class EncodingDetails(_EncodingDetails): 205 | + # XXX (ncoghlan): Using JSON for child state reporting may be less fragile 206 | + CHILD_PROCESS_SCRIPT = ";".join([ 207 | + "import sys, os", 208 | + "print(sys.getfilesystemencoding())", 209 | + "print(sys.stdin.encoding + ':' + sys.stdin.errors)", 210 | + "print(sys.stdout.encoding + ':' + sys.stdout.errors)", 211 | + "print(sys.stderr.encoding + ':' + sys.stderr.errors)", 212 | + "print(os.environ.get('LANG', 'not set'))", 213 | + "print(os.environ.get('LC_CTYPE', 'not set'))", 214 | + "print(os.environ.get('LC_ALL', 'not set'))", 215 | + ]) 216 | + 217 | + @classmethod 218 | + def get_expected_details(cls, coercion_expected, fs_encoding, stream_encoding, env_vars): 219 | + """Returns expected child process details for a given encoding""" 220 | + _stream = stream_encoding + ":{}" 221 | + # stdin and stdout should use surrogateescape either because the 222 | + # coercion triggered, or because the C locale was detected 223 | + stream_info = 2*[_stream.format("surrogateescape")] 224 | + # stderr should always use backslashreplace 225 | + stream_info.append(_stream.format("backslashreplace")) 226 | + expected_lang = env_vars.get("LANG", "not set").lower() 227 | + if coercion_expected: 228 | + expected_lc_ctype = CLI_COERCION_TARGET.lower() 229 | + else: 230 | + expected_lc_ctype = env_vars.get("LC_CTYPE", "not set").lower() 231 | + expected_lc_all = env_vars.get("LC_ALL", "not set").lower() 232 | + env_info = expected_lang, expected_lc_ctype, expected_lc_all 233 | + return dict(cls(fs_encoding, *stream_info, *env_info)._asdict()) 234 | + 235 | + @staticmethod 236 | + def _handle_output_variations(data): 237 | + """Adjust the output to handle platform specific idiosyncrasies 238 | + 239 | + * Some platforms report ASCII as ANSI_X3.4-1968 240 | + * Some platforms report ASCII as US-ASCII 241 | + * Some platforms report UTF-8 instead of utf-8 242 | + """ 243 | + data = data.replace(b"ANSI_X3.4-1968", b"ascii") 244 | + data = data.replace(b"US-ASCII", b"ascii") 245 | + data = data.lower() 246 | + return data 247 | + 248 | + @classmethod 249 | + def get_child_details(cls, env_vars): 250 | + """Retrieves fsencoding and standard stream details from a child process 251 | + 252 | + Returns (encoding_details, stderr_lines): 253 | + 254 | + - encoding_details: EncodingDetails for eager decoding 255 | + - stderr_lines: result of calling splitlines() on the stderr output 256 | + 257 | + The child is run in isolated mode if the current interpreter supports 258 | + that. 259 | + """ 260 | + result, py_cmd = run_python_until_end( 261 | + "-c", cls.CHILD_PROCESS_SCRIPT, 262 | + __isolated=True, 263 | + **env_vars 264 | + ) 265 | + if not result.rc == 0: 266 | + result.fail(py_cmd) 267 | + # All subprocess outputs in this test case should be pure ASCII 268 | + adjusted_output = cls._handle_output_variations(result.out) 269 | + stdout_lines = adjusted_output.decode("ascii").splitlines() 270 | + child_encoding_details = dict(cls(*stdout_lines)._asdict()) 271 | + stderr_lines = result.err.decode("ascii").rstrip().splitlines() 272 | + return child_encoding_details, stderr_lines 273 | + 274 | + 275 | +# Details of the shared library warning emitted at runtime 276 | +LEGACY_LOCALE_WARNING = ( 277 | + "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " 278 | + "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " 279 | + "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " 280 | + "locales is recommended." 281 | +) 282 | + 283 | +# Details of the CLI locale coercion warning emitted at runtime 284 | +CLI_COERCION_WARNING_FMT = ( 285 | + "Python detected LC_CTYPE=C: LC_CTYPE coerced to {} (set another locale " 286 | + "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior)." 287 | +) 288 | + 289 | + 290 | +AVAILABLE_TARGETS = None 291 | +CLI_COERCION_TARGET = None 292 | +CLI_COERCION_WARNING = None 293 | + 294 | +def setUpModule(): 295 | + global AVAILABLE_TARGETS 296 | + global CLI_COERCION_TARGET 297 | + global CLI_COERCION_WARNING 298 | + 299 | + if AVAILABLE_TARGETS is not None: 300 | + # initialization already done 301 | + return 302 | + AVAILABLE_TARGETS = [] 303 | + 304 | + # Find the target locales available in the current system 305 | + for target_locale in _C_UTF8_LOCALES: 306 | + if _set_locale_in_subprocess(target_locale): 307 | + AVAILABLE_TARGETS.append(target_locale) 308 | + 309 | + if AVAILABLE_TARGETS: 310 | + # Coercion is expected to use the first available target locale 311 | + CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] 312 | + CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) 313 | + 314 | + 315 | +class _LocaleHandlingTestCase(unittest.TestCase): 316 | + # Base class to check expected locale handling behaviour 317 | + 318 | + def _check_child_encoding_details(self, 319 | + env_vars, 320 | + expected_fs_encoding, 321 | + expected_stream_encoding, 322 | + expected_warnings, 323 | + coercion_expected): 324 | + """Check the C locale handling for the given process environment 325 | + 326 | + Parameters: 327 | + expected_fs_encoding: expected sys.getfilesystemencoding() result 328 | + expected_stream_encoding: expected encoding for standard streams 329 | + expected_warning: stderr output to expect (if any) 330 | + """ 331 | + result = EncodingDetails.get_child_details(env_vars) 332 | + encoding_details, stderr_lines = result 333 | + expected_details = EncodingDetails.get_expected_details( 334 | + coercion_expected, 335 | + expected_fs_encoding, 336 | + expected_stream_encoding, 337 | + env_vars 338 | + ) 339 | + self.assertEqual(encoding_details, expected_details) 340 | + if expected_warnings is None: 341 | + expected_warnings = [] 342 | + self.assertEqual(stderr_lines, expected_warnings) 343 | + 344 | + 345 | +class LocaleConfigurationTests(_LocaleHandlingTestCase): 346 | + # Test explicit external configuration via the process environment 347 | + 348 | + def setUpClass(): 349 | + # This relies on setupModule() having been run, so it can't be 350 | + # handled via the @unittest.skipUnless decorator 351 | + if not AVAILABLE_TARGETS: 352 | + raise unittest.SkipTest("No C-with-UTF-8 locale available") 353 | + 354 | + def test_external_target_locale_configuration(self): 355 | + 356 | + # Explicitly setting a target locale should give the same behaviour as 357 | + # is seen when implicitly coercing to that target locale 358 | + self.maxDiff = None 359 | + 360 | + expected_fs_encoding = "utf-8" 361 | + expected_stream_encoding = "utf-8" 362 | + 363 | + base_var_dict = { 364 | + "LANG": "", 365 | + "LC_CTYPE": "", 366 | + "LC_ALL": "", 367 | + } 368 | + for env_var in ("LANG", "LC_CTYPE"): 369 | + for locale_to_set in AVAILABLE_TARGETS: 370 | + # XXX (ncoghlan): LANG=UTF-8 doesn't appear to work as 371 | + # expected, so skip that combination for now 372 | + # See https://bugs.python.org/issue30672 for discussion 373 | + if env_var == "LANG" and locale_to_set == "UTF-8": 374 | + continue 375 | + 376 | + with self.subTest(env_var=env_var, 377 | + configured_locale=locale_to_set): 378 | + var_dict = base_var_dict.copy() 379 | + var_dict[env_var] = locale_to_set 380 | + self._check_child_encoding_details(var_dict, 381 | + expected_fs_encoding, 382 | + expected_stream_encoding, 383 | + expected_warnings=None, 384 | + coercion_expected=False) 385 | + 386 | + 387 | + 388 | +@test.support.cpython_only 389 | +@unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), 390 | + "C locale coercion disabled at build time") 391 | +class LocaleCoercionTests(_LocaleHandlingTestCase): 392 | + # Test implicit reconfiguration of the environment during CLI startup 393 | + 394 | + def _check_c_locale_coercion(self, 395 | + fs_encoding, stream_encoding, 396 | + coerce_c_locale, 397 | + expected_warnings=None, 398 | + coercion_expected=True, 399 | + **extra_vars): 400 | + """Check the C locale handling for various configurations 401 | + 402 | + Parameters: 403 | + fs_encoding: expected sys.getfilesystemencoding() result 404 | + stream_encoding: expected encoding for standard streams 405 | + coerce_c_locale: setting to use for PYTHONCOERCECLOCALE 406 | + None: don't set the variable at all 407 | + str: the value set in the child's environment 408 | + expected_warnings: expected warning lines on stderr 409 | + extra_vars: additional environment variables to set in subprocess 410 | + """ 411 | + self.maxDiff = None 412 | + 413 | + if not AVAILABLE_TARGETS: 414 | + # Locale coercion is disabled when there aren't any target locales 415 | + fs_encoding = C_LOCALE_FS_ENCODING 416 | + stream_encoding = C_LOCALE_STREAM_ENCODING 417 | + coercion_expected = False 418 | + if expected_warnings: 419 | + expected_warnings = [LEGACY_LOCALE_WARNING] 420 | + 421 | + base_var_dict = { 422 | + "LANG": "", 423 | + "LC_CTYPE": "", 424 | + "LC_ALL": "", 425 | + } 426 | + base_var_dict.update(extra_vars) 427 | + for env_var in ("LANG", "LC_CTYPE"): 428 | + for locale_to_set in ("", "C", "POSIX", "invalid.ascii"): 429 | + # XXX (ncoghlan): *BSD platforms don't behave as expected in the 430 | + # POSIX locale, so we skip that for now 431 | + # See https://bugs.python.org/issue30672 for discussion 432 | + if locale_to_set == "POSIX": 433 | + continue 434 | + with self.subTest(env_var=env_var, 435 | + nominal_locale=locale_to_set, 436 | + PYTHONCOERCECLOCALE=coerce_c_locale): 437 | + var_dict = base_var_dict.copy() 438 | + var_dict[env_var] = locale_to_set 439 | + if coerce_c_locale is not None: 440 | + var_dict["PYTHONCOERCECLOCALE"] = coerce_c_locale 441 | + # Check behaviour on successful coercion 442 | + self._check_child_encoding_details(var_dict, 443 | + fs_encoding, 444 | + stream_encoding, 445 | + expected_warnings, 446 | + coercion_expected) 447 | + 448 | + def test_test_PYTHONCOERCECLOCALE_not_set(self): 449 | + # This should coerce to the first available target locale by default 450 | + self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=None) 451 | + 452 | + def test_PYTHONCOERCECLOCALE_not_zero(self): 453 | + # *Any* string other than "0" is considered "set" for our purposes 454 | + # and hence should result in the locale coercion being enabled 455 | + for setting in ("", "1", "true", "false"): 456 | + self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=setting) 457 | + 458 | + def test_PYTHONCOERCECLOCALE_set_to_warn(self): 459 | + # PYTHONCOERCECLOCALE=warn enables runtime warnings for legacy locales 460 | + self._check_c_locale_coercion("utf-8", "utf-8", 461 | + coerce_c_locale="warn", 462 | + expected_warnings=[CLI_COERCION_WARNING]) 463 | + 464 | + 465 | + def test_PYTHONCOERCECLOCALE_set_to_zero(self): 466 | + # The setting "0" should result in the locale coercion being disabled 467 | + self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, 468 | + C_LOCALE_STREAM_ENCODING, 469 | + coerce_c_locale="0", 470 | + coercion_expected=False) 471 | + # Setting LC_ALL=C shouldn't make any difference to the behaviour 472 | + self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, 473 | + C_LOCALE_STREAM_ENCODING, 474 | + coerce_c_locale="0", 475 | + LC_ALL="C", 476 | + coercion_expected=False) 477 | + 478 | + def test_LC_ALL_set_to_C(self): 479 | + # Setting LC_ALL should render the locale coercion ineffective 480 | + self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, 481 | + C_LOCALE_STREAM_ENCODING, 482 | + coerce_c_locale=None, 483 | + LC_ALL="C", 484 | + coercion_expected=False) 485 | + # And result in a warning about a lack of locale compatibility 486 | + self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, 487 | + C_LOCALE_STREAM_ENCODING, 488 | + coerce_c_locale="warn", 489 | + LC_ALL="C", 490 | + expected_warnings=[LEGACY_LOCALE_WARNING], 491 | + coercion_expected=False) 492 | + 493 | +def test_main(): 494 | + test.support.run_unittest( 495 | + LocaleConfigurationTests, 496 | + LocaleCoercionTests 497 | + ) 498 | + test.support.reap_children() 499 | + 500 | +if __name__ == "__main__": 501 | + test_main() 502 | diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py 503 | index 38156b4..5922ed9 100644 504 | --- a/Lib/test/test_cmd_line.py 505 | +++ b/Lib/test/test_cmd_line.py 506 | @@ -153,6 +153,7 @@ class CmdLineTest(unittest.TestCase): 507 | env = os.environ.copy() 508 | # Use C locale to get ascii for the locale encoding 509 | env['LC_ALL'] = 'C' 510 | + env['PYTHONCOERCECLOCALE'] = '0' 511 | code = ( 512 | b'import locale; ' 513 | b'print(ascii("' + undecodable + b'"), ' 514 | diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py 515 | index 7866a5c..b41239a 100644 516 | --- a/Lib/test/test_sys.py 517 | +++ b/Lib/test/test_sys.py 518 | @@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): 519 | # Force the POSIX locale 520 | env = os.environ.copy() 521 | env["LC_ALL"] = "C" 522 | + env["PYTHONCOERCECLOCALE"] = "0" 523 | code = '\n'.join(( 524 | 'import sys', 525 | 'def dump(name):', 526 | diff --git a/Modules/main.c b/Modules/main.c 527 | index 585d696..96d8be4 100644 528 | --- a/Modules/main.c 529 | +++ b/Modules/main.c 530 | @@ -107,7 +107,11 @@ static const char usage_6[] = 531 | " predictable seed.\n" 532 | "PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" 533 | " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" 534 | -" hooks.\n"; 535 | +" hooks.\n" 536 | + 537 | +"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" 538 | +" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" 539 | +" locale coercion and locale compatibility warnings on stderr.\n"; 540 | 541 | static int 542 | usage(int exitcode, const wchar_t* program) 543 | diff --git a/Programs/_testembed.c b/Programs/_testembed.c 544 | index 813cf30..2a64092 100644 545 | --- a/Programs/_testembed.c 546 | +++ b/Programs/_testembed.c 547 | @@ -1,4 +1,5 @@ 548 | #include 549 | +#include "pyconfig.h" 550 | #include "pythread.h" 551 | #include 552 | 553 | diff --git a/Programs/python.c b/Programs/python.c 554 | index a7afbc7..03f8295 100644 555 | --- a/Programs/python.c 556 | +++ b/Programs/python.c 557 | @@ -15,6 +15,21 @@ wmain(int argc, wchar_t **argv) 558 | } 559 | #else 560 | 561 | +/* Access private pylifecycle helper API to better handle the legacy C locale 562 | + * 563 | + * The legacy C locale assumes ASCII as the default text encoding, which 564 | + * causes problems not only for the CPython runtime, but also other 565 | + * components like GNU readline. 566 | + * 567 | + * Accordingly, when the CLI detects it, it attempts to coerce it to a 568 | + * more capable UTF-8 based alternative. 569 | + * 570 | + * See the documentation of the PYTHONCOERCECLOCALE setting for more details. 571 | + * 572 | + */ 573 | +extern int _Py_LegacyLocaleDetected(void); 574 | +extern void _Py_CoerceLegacyLocale(void); 575 | + 576 | int 577 | main(int argc, char **argv) 578 | { 579 | @@ -25,7 +40,11 @@ main(int argc, char **argv) 580 | char *oldloc; 581 | 582 | /* Force malloc() allocator to bootstrap Python */ 583 | +#ifdef Py_DEBUG 584 | + (void)_PyMem_SetupAllocators("malloc_debug"); 585 | +# else 586 | (void)_PyMem_SetupAllocators("malloc"); 587 | +# endif 588 | 589 | argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); 590 | argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); 591 | @@ -49,7 +68,21 @@ main(int argc, char **argv) 592 | return 1; 593 | } 594 | 595 | +#ifdef __ANDROID__ 596 | + /* Passing "" to setlocale() on Android requests the C locale rather 597 | + * than checking environment variables, so request C.UTF-8 explicitly 598 | + */ 599 | + setlocale(LC_ALL, "C.UTF-8"); 600 | +#else 601 | + /* Reconfigure the locale to the default for this process */ 602 | setlocale(LC_ALL, ""); 603 | +#endif 604 | + 605 | + if (_Py_LegacyLocaleDetected()) { 606 | + _Py_CoerceLegacyLocale(); 607 | + } 608 | + 609 | + /* Convert from char to wchar_t based on the locale settings */ 610 | for (i = 0; i < argc; i++) { 611 | argv_copy[i] = Py_DecodeLocale(argv[i], NULL); 612 | if (!argv_copy[i]) { 613 | @@ -70,7 +103,11 @@ main(int argc, char **argv) 614 | 615 | /* Force again malloc() allocator to release memory blocks allocated 616 | before Py_Main() */ 617 | +#ifdef Py_DEBUG 618 | + (void)_PyMem_SetupAllocators("malloc_debug"); 619 | +# else 620 | (void)_PyMem_SetupAllocators("malloc"); 621 | +# endif 622 | 623 | for (i = 0; i < argc; i++) { 624 | PyMem_RawFree(argv_copy2[i]); 625 | diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c 626 | index ecfdfee..4fee178 100644 627 | --- a/Python/pylifecycle.c 628 | +++ b/Python/pylifecycle.c 629 | @@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) 630 | return 0; 631 | } 632 | 633 | + 634 | /* Global initializations. Can be undone by Py_FinalizeEx(). Don't 635 | call this twice without an intervening Py_FinalizeEx() call. When 636 | initializations fail, a fatal error is issued and the function does 637 | @@ -301,6 +302,183 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) 638 | } 639 | 640 | 641 | +/* Helper functions to better handle the legacy C locale 642 | + * 643 | + * The legacy C locale assumes ASCII as the default text encoding, which 644 | + * causes problems not only for the CPython runtime, but also other 645 | + * components like GNU readline. 646 | + * 647 | + * Accordingly, when the CLI detects it, it attempts to coerce it to a 648 | + * more capable UTF-8 based alternative as follows: 649 | + * 650 | + * if (_Py_LegacyLocaleDetected()) { 651 | + * _Py_CoerceLegacyLocale(); 652 | + * } 653 | + * 654 | + * See the documentation of the PYTHONCOERCECLOCALE setting for more details. 655 | + * 656 | + * Locale coercion also impacts the default error handler for the standard 657 | + * streams: while the usual default is "strict", the default for the legacy 658 | + * C locale and for any of the coercion target locales is "surrogateescape". 659 | + */ 660 | + 661 | +int 662 | +_Py_LegacyLocaleDetected(void) 663 | +{ 664 | +#ifndef MS_WINDOWS 665 | + /* On non-Windows systems, the C locale is considered a legacy locale */ 666 | + /* XXX (ncoghlan): some platforms (notably Mac OS X) don't appear to treat 667 | + * the POSIX locale as a simple alias for the C locale, so 668 | + * we may also want to check for that explicitly. 669 | + */ 670 | + const char *ctype_loc = setlocale(LC_CTYPE, NULL); 671 | + return ctype_loc != NULL && strcmp(ctype_loc, "C") == 0; 672 | +#else 673 | + /* Windows uses code pages instead of locales, so no locale is legacy */ 674 | + return 0; 675 | +#endif 676 | +} 677 | + 678 | + 679 | +static const char *_C_LOCALE_WARNING = 680 | + "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " 681 | + "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " 682 | + "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " 683 | + "locales is recommended.\n"; 684 | + 685 | +static int 686 | +_legacy_locale_warnings_enabled(void) 687 | +{ 688 | + const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); 689 | + return (coerce_c_locale != NULL && 690 | + strncmp(coerce_c_locale, "warn", 5) == 0); 691 | +} 692 | + 693 | +static void 694 | +_emit_stderr_warning_for_legacy_locale(void) 695 | +{ 696 | + if (_legacy_locale_warnings_enabled()) { 697 | + if (_Py_LegacyLocaleDetected()) { 698 | + fprintf(stderr, "%s", _C_LOCALE_WARNING); 699 | + } 700 | + } 701 | +} 702 | + 703 | +typedef struct _CandidateLocale { 704 | + const char *locale_name; /* The locale to try as a coercion target */ 705 | +} _LocaleCoercionTarget; 706 | + 707 | +static _LocaleCoercionTarget _TARGET_LOCALES[] = { 708 | + {"C.UTF-8"}, 709 | + {"C.utf8"}, 710 | + {"UTF-8"}, 711 | + {NULL} 712 | +}; 713 | + 714 | +static char * 715 | +get_default_standard_stream_error_handler(void) 716 | +{ 717 | + const char *ctype_loc = setlocale(LC_CTYPE, NULL); 718 | + if (ctype_loc != NULL) { 719 | + /* "surrogateescape" is the default in the legacy C locale */ 720 | + if (strcmp(ctype_loc, "C") == 0) { 721 | + return "surrogateescape"; 722 | + } 723 | + 724 | +#ifdef PY_COERCE_C_LOCALE 725 | + /* "surrogateescape" is the default in locale coercion target locales */ 726 | + const _LocaleCoercionTarget *target = NULL; 727 | + for (target = _TARGET_LOCALES; target->locale_name; target++) { 728 | + if (strcmp(ctype_loc, target->locale_name) == 0) { 729 | + return "surrogateescape"; 730 | + } 731 | + } 732 | +#endif 733 | + } 734 | + 735 | + /* Otherwise return NULL to request the typical default error handler */ 736 | + return NULL; 737 | +} 738 | + 739 | +#ifdef PY_COERCE_C_LOCALE 740 | +static const char *_C_LOCALE_COERCION_WARNING = 741 | + "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale " 742 | + "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; 743 | + 744 | +static void 745 | +_coerce_default_locale_settings(const _LocaleCoercionTarget *target) 746 | +{ 747 | + 748 | + const char *newloc = target->locale_name; 749 | + 750 | + /* Reset locale back to currently configured defaults */ 751 | + setlocale(LC_ALL, ""); 752 | + 753 | + /* Set the relevant locale environment variable */ 754 | + if (setenv("LC_CTYPE", newloc, 1)) { 755 | + fprintf(stderr, 756 | + "Error setting LC_CTYPE, skipping C locale coercion\n"); 757 | + return; 758 | + } 759 | + if (_legacy_locale_warnings_enabled()) { 760 | + fprintf(stderr, _C_LOCALE_COERCION_WARNING, newloc); 761 | + } 762 | + 763 | + /* Reconfigure with the overridden environment variables */ 764 | + setlocale(LC_ALL, ""); 765 | +} 766 | +#endif 767 | + 768 | + 769 | +void 770 | +_Py_CoerceLegacyLocale(void) 771 | +{ 772 | +#ifdef PY_COERCE_C_LOCALE 773 | + /* We ignore the Python -E and -I flags here, as the CLI needs to sort out 774 | + * the locale settings *before* we try to do anything with the command 775 | + * line arguments. For cross-platform debugging purposes, we also need 776 | + * to give end users a way to force even scripts that are otherwise 777 | + * isolated from their environment to use the legacy ASCII-centric C 778 | + * locale. 779 | + * 780 | + * Ignoring -E and -I is safe from a security perspective, as we only use 781 | + * the setting to turn *off* the implicit locale coercion, and anyone with 782 | + * access to the process environment already has the ability to set 783 | + * `LC_ALL=C` to override the C level locale settings anyway. 784 | + */ 785 | + const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); 786 | + if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { 787 | + /* PYTHONCOERCECLOCALE is not set, or is set to something other than "0" */ 788 | + const char *locale_override = getenv("LC_ALL"); 789 | + if (locale_override == NULL || *locale_override == '\0') { 790 | + /* LC_ALL is also not set (or is set to an empty string) */ 791 | + const _LocaleCoercionTarget *target = NULL; 792 | + for (target = _TARGET_LOCALES; target->locale_name; target++) { 793 | + const char *new_locale = setlocale(LC_CTYPE, 794 | + target->locale_name); 795 | + if (new_locale != NULL) { 796 | +#if !defined(__APPLE__) && defined(HAVE_LANGINFO_H) && defined(CODESET) 797 | + /* Also ensure that nl_langinfo works in this locale */ 798 | + char *codeset = nl_langinfo(CODESET); 799 | + if (!codeset || *codeset == '\0') { 800 | + /* CODESET is not set or empty, so skip coercion */ 801 | + new_locale = NULL; 802 | + setlocale(LC_CTYPE, ""); 803 | + continue; 804 | + } 805 | +#endif 806 | + /* Successfully configured locale, so make it the default */ 807 | + _coerce_default_locale_settings(target); 808 | + return; 809 | + } 810 | + } 811 | + } 812 | + } 813 | + /* No C locale warning here, as Py_Initialize will emit one later */ 814 | +#endif 815 | +} 816 | + 817 | + 818 | void 819 | _Py_InitializeEx_Private(int install_sigs, int install_importlib) 820 | { 821 | @@ -315,11 +493,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) 822 | initialized = 1; 823 | _Py_Finalizing = NULL; 824 | 825 | -#ifdef HAVE_SETLOCALE 826 | +#ifdef __ANDROID__ 827 | + /* Passing "" to setlocale() on Android requests the C locale rather 828 | + * than checking environment variables, so request C.UTF-8 explicitly 829 | + */ 830 | + setlocale(LC_CTYPE, "C.UTF-8"); 831 | +#else 832 | +#ifndef MS_WINDOWS 833 | /* Set up the LC_CTYPE locale, so we can obtain 834 | the locale's charset without having to switch 835 | locales. */ 836 | setlocale(LC_CTYPE, ""); 837 | + _emit_stderr_warning_for_legacy_locale(); 838 | +#endif 839 | #endif 840 | 841 | if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') 842 | @@ -1247,12 +1433,8 @@ initstdio(void) 843 | } 844 | } 845 | if (!errors && !(pythonioencoding && *pythonioencoding)) { 846 | - /* When the LC_CTYPE locale is the POSIX locale ("C locale"), 847 | - stdin and stdout use the surrogateescape error handler by 848 | - default, instead of the strict error handler. */ 849 | - char *loc = setlocale(LC_CTYPE, NULL); 850 | - if (loc != NULL && strcmp(loc, "C") == 0) 851 | - errors = "surrogateescape"; 852 | + /* Choose the default error handler based on the current locale */ 853 | + errors = get_default_standard_stream_error_handler(); 854 | } 855 | } 856 | 857 | diff --git a/configure.ac b/configure.ac 858 | index 3f2459a..7444486 100644 859 | --- a/configure.ac 860 | +++ b/configure.ac 861 | @@ -3360,6 +3360,40 @@ then 862 | fi 863 | AC_MSG_RESULT($with_pymalloc) 864 | 865 | +# Check for --with-c-locale-coercion 866 | +AC_MSG_CHECKING(for --with-c-locale-coercion) 867 | +AC_ARG_WITH(c-locale-coercion, 868 | + AS_HELP_STRING([--with(out)-c-locale-coercion], 869 | + [disable/enable C locale coercion to a UTF-8 based locale])) 870 | + 871 | +if test -z "$with_c_locale_coercion" 872 | +then 873 | + with_c_locale_coercion="yes" 874 | +fi 875 | +if test "$with_c_locale_coercion" != "no" 876 | +then 877 | + AC_DEFINE(PY_COERCE_C_LOCALE, 1, 878 | + [Define if you want to coerce the C locale to a UTF-8 based locale]) 879 | +fi 880 | +AC_MSG_RESULT($with_c_locale_coercion) 881 | + 882 | +# Check for --with-c-locale-warning 883 | +AC_MSG_CHECKING(for --with-c-locale-warning) 884 | +AC_ARG_WITH(c-locale-warning, 885 | + AS_HELP_STRING([--with(out)-c-locale-warning], 886 | + [disable/enable locale compatibility warning in the C locale])) 887 | + 888 | +if test -z "$with_c_locale_warning" 889 | +then 890 | + with_c_locale_warning="yes" 891 | +fi 892 | +if test "$with_c_locale_warning" != "no" 893 | +then 894 | + AC_DEFINE(PY_WARN_ON_C_LOCALE, 1, 895 | + [Define to emit a locale compatibility warning in the C locale]) 896 | +fi 897 | +AC_MSG_RESULT($with_c_locale_warning) 898 | + 899 | # Check for Valgrind support 900 | AC_MSG_CHECKING([for --with-valgrind]) 901 | AC_ARG_WITH([valgrind], 902 | -------------------------------------------------------------------------------- /00274-fix-arch-names.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.5.0/configure.ac.than Python-3.5.0/configure.ac 2 | --- Python-3.5.0/configure.ac.than 2015-11-13 11:51:32.039560172 -0500 3 | +++ Python-3.5.0/configure.ac 2015-11-13 11:52:11.670168157 -0500 4 | @@ -788,9 +788,9 @@ cat >> conftest.c <> conftest.c <> conftest.c <> conftest.c <= (1, 1, 0) 97 | - 98 | +PY_SSL_DEFAULT_CIPHERS = sysconfig.get_config_var('PY_SSL_DEFAULT_CIPHERS') 99 | 100 | def data_file(*name): 101 | return os.path.join(os.path.dirname(__file__), *name) 102 | @@ -889,6 +890,19 @@ class ContextTests(unittest.TestCase): 103 | with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"): 104 | ctx.set_ciphers("^$:,;?*'dorothyx") 105 | 106 | + @unittest.skipUnless(PY_SSL_DEFAULT_CIPHERS == 1, 107 | + "Test applies only to Python default ciphers") 108 | + def test_python_ciphers(self): 109 | + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) 110 | + ciphers = ctx.get_ciphers() 111 | + for suite in ciphers: 112 | + name = suite['name'] 113 | + self.assertNotIn("PSK", name) 114 | + self.assertNotIn("SRP", name) 115 | + self.assertNotIn("MD5", name) 116 | + self.assertNotIn("RC4", name) 117 | + self.assertNotIn("3DES", name) 118 | + 119 | @unittest.skipIf(ssl.OPENSSL_VERSION_INFO < (1, 0, 2, 0, 0), 'OpenSSL too old') 120 | def test_get_ciphers(self): 121 | ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 122 | diff --git a/Modules/_ssl.c b/Modules/_ssl.c 123 | index 5e007da..130f006 100644 124 | --- a/Modules/_ssl.c 125 | +++ b/Modules/_ssl.c 126 | @@ -237,6 +237,31 @@ SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s) 127 | 128 | #endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */ 129 | 130 | +/* Default cipher suites */ 131 | +#ifndef PY_SSL_DEFAULT_CIPHERS 132 | +#define PY_SSL_DEFAULT_CIPHERS 1 133 | +#endif 134 | + 135 | +#if PY_SSL_DEFAULT_CIPHERS == 0 136 | + #ifndef PY_SSL_DEFAULT_CIPHER_STRING 137 | + #error "Py_SSL_DEFAULT_CIPHERS 0 needs Py_SSL_DEFAULT_CIPHER_STRING" 138 | + #endif 139 | +#elif PY_SSL_DEFAULT_CIPHERS == 1 140 | +/* Python custom selection of sensible ciper suites 141 | + * DEFAULT: OpenSSL's default cipher list. Since 1.0.2 the list is in sensible order. 142 | + * !aNULL:!eNULL: really no NULL ciphers 143 | + * !MD5:!3DES:!DES:!RC4:!IDEA:!SEED: no weak or broken algorithms on old OpenSSL versions. 144 | + * !aDSS: no authentication with discrete logarithm DSA algorithm 145 | + * !SRP:!PSK: no secure remote password or pre-shared key authentication 146 | + */ 147 | + #define PY_SSL_DEFAULT_CIPHER_STRING "DEFAULT:!aNULL:!eNULL:!MD5:!3DES:!DES:!RC4:!IDEA:!SEED:!aDSS:!SRP:!PSK" 148 | +#elif PY_SSL_DEFAULT_CIPHERS == 2 149 | +/* Ignored in SSLContext constructor, only used to as _ssl.DEFAULT_CIPHER_STRING */ 150 | + #define PY_SSL_DEFAULT_CIPHER_STRING SSL_DEFAULT_CIPHER_LIST 151 | +#else 152 | + #error "Unsupported PY_SSL_DEFAULT_CIPHERS" 153 | +#endif 154 | + 155 | 156 | enum py_ssl_error { 157 | /* these mirror ssl.h */ 158 | @@ -2803,7 +2828,12 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version) 159 | /* A bare minimum cipher list without completely broken cipher suites. 160 | * It's far from perfect but gives users a better head start. */ 161 | if (proto_version != PY_SSL_VERSION_SSL2) { 162 | - result = SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!eNULL:!MD5"); 163 | +#if PY_SSL_DEFAULT_CIPHERS == 2 164 | + /* stick to OpenSSL's default settings */ 165 | + result = 1; 166 | +#else 167 | + result = SSL_CTX_set_cipher_list(ctx, PY_SSL_DEFAULT_CIPHER_STRING); 168 | +#endif 169 | } else { 170 | /* SSLv2 needs MD5 */ 171 | result = SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!eNULL"); 172 | @@ -5343,6 +5373,9 @@ PyInit__ssl(void) 173 | (PyObject *)&PySSLSession_Type) != 0) 174 | return NULL; 175 | 176 | + PyModule_AddStringConstant(m, "_DEFAULT_CIPHERS", 177 | + PY_SSL_DEFAULT_CIPHER_STRING); 178 | + 179 | PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN", 180 | PY_SSL_ERROR_ZERO_RETURN); 181 | PyModule_AddIntConstant(m, "SSL_ERROR_WANT_READ", 182 | diff --git a/configure.ac b/configure.ac 183 | index 3703701..2eff514 100644 184 | --- a/configure.ac 185 | +++ b/configure.ac 186 | @@ -5598,6 +5598,42 @@ if test "$have_getrandom" = yes; then 187 | [Define to 1 if the getrandom() function is available]) 188 | fi 189 | 190 | +# ssl module default cipher suite string 191 | +AH_TEMPLATE(PY_SSL_DEFAULT_CIPHERS, 192 | + [Default cipher suites list for ssl module. 193 | + 1: Python's preferred selection, 2: leave OpenSSL defaults untouched, 0: custom string]) 194 | +AH_TEMPLATE(PY_SSL_DEFAULT_CIPHER_STRING, 195 | + [Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0] 196 | +) 197 | +AC_MSG_CHECKING(for --with-ssl-default-suites) 198 | +AC_ARG_WITH(ssl-default-suites, 199 | + AS_HELP_STRING([--with-ssl-default-suites=@<:@python|openssl|STRING@:>@], 200 | + [Override default cipher suites string, 201 | + python: use Python's preferred selection (default), 202 | + openssl: leave OpenSSL's defaults untouched, 203 | + STRING: use a custom string, 204 | + PROTOCOL_SSLv2 ignores the setting]), 205 | +[ 206 | +AC_MSG_RESULT($withval) 207 | +case "$withval" in 208 | + python) 209 | + AC_DEFINE(PY_SSL_DEFAULT_CIPHERS, 1) 210 | + ;; 211 | + openssl) 212 | + AC_DEFINE(PY_SSL_DEFAULT_CIPHERS, 2) 213 | + ;; 214 | + *) 215 | + AC_DEFINE(PY_SSL_DEFAULT_CIPHERS, 0) 216 | + AC_DEFINE_UNQUOTED(PY_SSL_DEFAULT_CIPHER_STRING, "$withval") 217 | + ;; 218 | +esac 219 | +], 220 | +[ 221 | +AC_MSG_RESULT(python) 222 | +AC_DEFINE(PY_SSL_DEFAULT_CIPHERS, 1) 223 | +]) 224 | + 225 | + 226 | # generate output files 227 | AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh) 228 | AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) 229 | -------------------------------------------------------------------------------- /00316-mark-bdist_wininst-unsupported.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py 2 | index 0871a4f..8796b68 100644 3 | --- a/Lib/distutils/command/bdist_wininst.py 4 | +++ b/Lib/distutils/command/bdist_wininst.py 5 | @@ -12,6 +12,8 @@ from distutils.sysconfig import get_python_version 6 | from distutils import log 7 | 8 | class bdist_wininst(Command): 9 | + # Marker for tests that we have the unsupported bdist_wininst 10 | + _unsupported = True 11 | 12 | description = "create an executable installer for MS Windows" 13 | 14 | -------------------------------------------------------------------------------- /00317-CVE-2019-5010.patch: -------------------------------------------------------------------------------- 1 | From c660debb97f4f422255a82fef2d77804552c043a Mon Sep 17 00:00:00 2001 2 | From: Christian Heimes 3 | Date: Tue, 15 Jan 2019 18:16:30 +0100 4 | Subject: [PATCH] bpo-35746: Fix segfault in ssl's cert parser 5 | 6 | CVE-2019-5010, Fix a NULL pointer deref in ssl module. The cert parser did 7 | not handle CRL distribution points with empty DP or URI correctly. A 8 | malicious or buggy certificate can result into segfault. 9 | 10 | Signed-off-by: Christian Heimes 11 | --- 12 | Lib/test/talos-2019-0758.pem | 22 +++++++++++++++++++ 13 | Lib/test/test_ssl.py | 22 +++++++++++++++++++ 14 | .../2019-01-15-18-16-05.bpo-35746.nMSd0j.rst | 3 +++ 15 | Modules/_ssl.c | 4 ++++ 16 | 4 files changed, 51 insertions(+) 17 | create mode 100644 Lib/test/talos-2019-0758.pem 18 | create mode 100644 Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst 19 | 20 | diff --git a/Lib/test/talos-2019-0758.pem b/Lib/test/talos-2019-0758.pem 21 | new file mode 100644 22 | index 000000000000..13b95a77fd8a 23 | --- /dev/null 24 | +++ b/Lib/test/talos-2019-0758.pem 25 | @@ -0,0 +1,22 @@ 26 | +-----BEGIN CERTIFICATE----- 27 | +MIIDqDCCApKgAwIBAgIBAjALBgkqhkiG9w0BAQswHzELMAkGA1UEBhMCVUsxEDAO 28 | +BgNVBAMTB2NvZHktY2EwHhcNMTgwNjE4MTgwMDU4WhcNMjgwNjE0MTgwMDU4WjA7 29 | +MQswCQYDVQQGEwJVSzEsMCoGA1UEAxMjY29kZW5vbWljb24tdm0tMi50ZXN0Lmxh 30 | +bC5jaXNjby5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC63fGB 31 | +J80A9Av1GB0bptslKRIUtJm8EeEu34HkDWbL6AJY0P8WfDtlXjlPaLqFa6sqH6ES 32 | +V48prSm1ZUbDSVL8R6BYVYpOlK8/48xk4pGTgRzv69gf5SGtQLwHy8UPBKgjSZoD 33 | +5a5k5wJXGswhKFFNqyyxqCvWmMnJWxXTt2XDCiWc4g4YAWi4O4+6SeeHVAV9rV7C 34 | +1wxqjzKovVe2uZOHjKEzJbbIU6JBPb6TRfMdRdYOw98n1VXDcKVgdX2DuuqjCzHP 35 | +WhU4Tw050M9NaK3eXp4Mh69VuiKoBGOLSOcS8reqHIU46Reg0hqeL8LIL6OhFHIF 36 | +j7HR6V1X6F+BfRS/AgMBAAGjgdYwgdMwCQYDVR0TBAIwADAdBgNVHQ4EFgQUOktp 37 | +HQjxDXXUg8prleY9jeLKeQ4wTwYDVR0jBEgwRoAUx6zgPygZ0ZErF9sPC4+5e2Io 38 | +UU+hI6QhMB8xCzAJBgNVBAYTAlVLMRAwDgYDVQQDEwdjb2R5LWNhggkA1QEAuwb7 39 | +2s0wCQYDVR0SBAIwADAuBgNVHREEJzAlgiNjb2Rlbm9taWNvbi12bS0yLnRlc3Qu 40 | +bGFsLmNpc2NvLmNvbTAOBgNVHQ8BAf8EBAMCBaAwCwYDVR0fBAQwAjAAMAsGCSqG 41 | +SIb3DQEBCwOCAQEAvqantx2yBlM11RoFiCfi+AfSblXPdrIrHvccepV4pYc/yO6p 42 | +t1f2dxHQb8rWH3i6cWag/EgIZx+HJQvo0rgPY1BFJsX1WnYf1/znZpkUBGbVmlJr 43 | +t/dW1gSkNS6sPsM0Q+7HPgEv8CPDNK5eo7vU2seE0iWOkxSyVUuiCEY9ZVGaLVit 44 | +p0C78nZ35Pdv4I+1cosmHl28+es1WI22rrnmdBpH8J1eY6WvUw2xuZHLeNVN0TzV 45 | +Q3qq53AaCWuLOD1AjESWuUCxMZTK9DPS4JKXTK8RLyDeqOvJGjsSWp3kL0y3GaQ+ 46 | +10T1rfkKJub2+m9A9duin1fn6tHc2wSvB7m3DA== 47 | +-----END CERTIFICATE----- 48 | diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py 49 | index 7f6b93148f45..1fc657f4d867 100644 50 | --- a/Lib/test/test_ssl.py 51 | +++ b/Lib/test/test_ssl.py 52 | @@ -115,6 +115,7 @@ def data_file(*name): 53 | BADKEY = data_file("badkey.pem") 54 | NOKIACERT = data_file("nokia.pem") 55 | NULLBYTECERT = data_file("nullbytecert.pem") 56 | +TALOS_INVALID_CRLDP = data_file("talos-2019-0758.pem") 57 | 58 | DHFILE = data_file("ffdh3072.pem") 59 | BYTES_DHFILE = os.fsencode(DHFILE) 60 | @@ -348,6 +349,27 @@ def test_parse_cert(self): 61 | self.assertEqual(p['crlDistributionPoints'], 62 | ('http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl',)) 63 | 64 | + def test_parse_cert_CVE_2019_5010(self): 65 | + p = ssl._ssl._test_decode_cert(TALOS_INVALID_CRLDP) 66 | + if support.verbose: 67 | + sys.stdout.write("\n" + pprint.pformat(p) + "\n") 68 | + self.assertEqual( 69 | + p, 70 | + { 71 | + 'issuer': ( 72 | + (('countryName', 'UK'),), (('commonName', 'cody-ca'),)), 73 | + 'notAfter': 'Jun 14 18:00:58 2028 GMT', 74 | + 'notBefore': 'Jun 18 18:00:58 2018 GMT', 75 | + 'serialNumber': '02', 76 | + 'subject': ((('countryName', 'UK'),), 77 | + (('commonName', 78 | + 'codenomicon-vm-2.test.lal.cisco.com'),)), 79 | + 'subjectAltName': ( 80 | + ('DNS', 'codenomicon-vm-2.test.lal.cisco.com'),), 81 | + 'version': 3 82 | + } 83 | + ) 84 | + 85 | def test_parse_cert_CVE_2013_4238(self): 86 | p = ssl._ssl._test_decode_cert(NULLBYTECERT) 87 | if support.verbose: 88 | diff --git a/Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst b/Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst 89 | new file mode 100644 90 | index 000000000000..dffe347eec84 91 | --- /dev/null 92 | +++ b/Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst 93 | @@ -0,0 +1,3 @@ 94 | +[CVE-2019-5010] Fix a NULL pointer deref in ssl module. The cert parser did 95 | +not handle CRL distribution points with empty DP or URI correctly. A 96 | +malicious or buggy certificate can result into segfault. 97 | diff --git a/Modules/_ssl.c b/Modules/_ssl.c 98 | index 4e3352d9e661..0e720e268d93 100644 99 | --- a/Modules/_ssl.c 100 | +++ b/Modules/_ssl.c 101 | @@ -1515,6 +1515,10 @@ _get_crl_dp(X509 *certificate) { 102 | STACK_OF(GENERAL_NAME) *gns; 103 | 104 | dp = sk_DIST_POINT_value(dps, i); 105 | + if (dp->distpoint == NULL) { 106 | + /* Ignore empty DP value, CVE-2019-5010 */ 107 | + continue; 108 | + } 109 | gns = dp->distpoint->name.fullname; 110 | 111 | for (j=0; j < sk_GENERAL_NAME_num(gns); j++) { 112 | -------------------------------------------------------------------------------- /00320-CVE-2019-9636-and-CVE-2019-10160.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst 2 | index d991254..647af61 100644 3 | --- a/Doc/library/urllib.parse.rst 4 | +++ b/Doc/library/urllib.parse.rst 5 | @@ -121,6 +121,11 @@ or on combining URL components into a URL string. 6 | Unmatched square brackets in the :attr:`netloc` attribute will raise a 7 | :exc:`ValueError`. 8 | 9 | + Characters in the :attr:`netloc` attribute that decompose under NFKC 10 | + normalization (as used by the IDNA encoding) into any of ``/``, ``?``, 11 | + ``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is 12 | + decomposed before parsing, no error will be raised. 13 | + 14 | .. versionchanged:: 3.2 15 | Added IPv6 URL parsing capabilities. 16 | 17 | @@ -133,6 +138,10 @@ or on combining URL components into a URL string. 18 | Out-of-range port numbers now raise :exc:`ValueError`, instead of 19 | returning :const:`None`. 20 | 21 | + .. versionchanged:: 3.6.9 22 | + Characters that affect netloc parsing under NFKC normalization will 23 | + now raise :exc:`ValueError`. 24 | + 25 | 26 | .. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None) 27 | 28 | @@ -256,10 +265,19 @@ or on combining URL components into a URL string. 29 | Unmatched square brackets in the :attr:`netloc` attribute will raise a 30 | :exc:`ValueError`. 31 | 32 | + Characters in the :attr:`netloc` attribute that decompose under NFKC 33 | + normalization (as used by the IDNA encoding) into any of ``/``, ``?``, 34 | + ``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is 35 | + decomposed before parsing, no error will be raised. 36 | + 37 | .. versionchanged:: 3.6 38 | Out-of-range port numbers now raise :exc:`ValueError`, instead of 39 | returning :const:`None`. 40 | 41 | + .. versionchanged:: 3.6.9 42 | + Characters that affect netloc parsing under NFKC normalization will 43 | + now raise :exc:`ValueError`. 44 | + 45 | 46 | .. function:: urlunsplit(parts) 47 | 48 | diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py 49 | index be50b47..68f633c 100644 50 | --- a/Lib/test/test_urlparse.py 51 | +++ b/Lib/test/test_urlparse.py 52 | @@ -1,3 +1,5 @@ 53 | +import sys 54 | +import unicodedata 55 | import unittest 56 | import urllib.parse 57 | 58 | @@ -984,6 +986,34 @@ class UrlParseTestCase(unittest.TestCase): 59 | expected.append(name) 60 | self.assertCountEqual(urllib.parse.__all__, expected) 61 | 62 | + def test_urlsplit_normalization(self): 63 | + # Certain characters should never occur in the netloc, 64 | + # including under normalization. 65 | + # Ensure that ALL of them are detected and cause an error 66 | + illegal_chars = '/:#?@' 67 | + hex_chars = {'{:04X}'.format(ord(c)) for c in illegal_chars} 68 | + denorm_chars = [ 69 | + c for c in map(chr, range(128, sys.maxunicode)) 70 | + if (hex_chars & set(unicodedata.decomposition(c).split())) 71 | + and c not in illegal_chars 72 | + ] 73 | + # Sanity check that we found at least one such character 74 | + self.assertIn('\u2100', denorm_chars) 75 | + self.assertIn('\uFF03', denorm_chars) 76 | + 77 | + # bpo-36742: Verify port separators are ignored when they 78 | + # existed prior to decomposition 79 | + urllib.parse.urlsplit('http://\u30d5\u309a:80') 80 | + with self.assertRaises(ValueError): 81 | + urllib.parse.urlsplit('http://\u30d5\u309a\ufe1380') 82 | + 83 | + for scheme in ["http", "https", "ftp"]: 84 | + for netloc in ["netloc{}false.netloc", "n{}user@netloc"]: 85 | + for c in denorm_chars: 86 | + url = "{}://{}/path".format(scheme, netloc.format(c)) 87 | + with self.subTest(url=url, char='{:04X}'.format(ord(c))): 88 | + with self.assertRaises(ValueError): 89 | + urllib.parse.urlsplit(url) 90 | 91 | class Utility_Tests(unittest.TestCase): 92 | """Testcase to test the various utility functions in the urllib.""" 93 | diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py 94 | index 85e68c8..fa8827a 100644 95 | --- a/Lib/urllib/parse.py 96 | +++ b/Lib/urllib/parse.py 97 | @@ -391,6 +391,24 @@ def _splitnetloc(url, start=0): 98 | delim = min(delim, wdelim) # use earliest delim position 99 | return url[start:delim], url[delim:] # return (domain, rest) 100 | 101 | +def _checknetloc(netloc): 102 | + if not netloc or not any(ord(c) > 127 for c in netloc): 103 | + return 104 | + # looking for characters like \u2100 that expand to 'a/c' 105 | + # IDNA uses NFKC equivalence, so normalize for this check 106 | + import unicodedata 107 | + n = netloc.replace('@', '') # ignore characters already included 108 | + n = n.replace(':', '') # but not the surrounding text 109 | + n = n.replace('#', '') 110 | + n = n.replace('?', '') 111 | + netloc2 = unicodedata.normalize('NFKC', n) 112 | + if n == netloc2: 113 | + return 114 | + for c in '/?#@:': 115 | + if c in netloc2: 116 | + raise ValueError("netloc '" + netloc + "' contains invalid " + 117 | + "characters under NFKC normalization") 118 | + 119 | def urlsplit(url, scheme='', allow_fragments=True): 120 | """Parse a URL into 5 components: 121 | :///?# 122 | @@ -420,6 +438,7 @@ def urlsplit(url, scheme='', allow_fragments=True): 123 | url, fragment = url.split('#', 1) 124 | if '?' in url: 125 | url, query = url.split('?', 1) 126 | + _checknetloc(netloc) 127 | v = SplitResult(scheme, netloc, url, query, fragment) 128 | _parse_cache[key] = v 129 | return _coerce_result(v) 130 | @@ -443,6 +462,7 @@ def urlsplit(url, scheme='', allow_fragments=True): 131 | url, fragment = url.split('#', 1) 132 | if '?' in url: 133 | url, query = url.split('?', 1) 134 | + _checknetloc(netloc) 135 | v = SplitResult(scheme, netloc, url, query, fragment) 136 | _parse_cache[key] = v 137 | return _coerce_result(v) 138 | -------------------------------------------------------------------------------- /00324-disallow-control-chars-in-http-urls.patch: -------------------------------------------------------------------------------- 1 | From 7e200e0763f5b71c199aaf98bd5588f291585619 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= 3 | Date: Tue, 7 May 2019 17:28:47 +0200 4 | Subject: [PATCH] bpo-30458: Disallow control chars in http URLs. (GH-12755) 5 | (GH-13154) 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; charset=UTF-8 8 | Content-Transfer-Encoding: 8bit 9 | 10 | Disallow control chars in http URLs in urllib.urlopen. This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected. 11 | 12 | Disable https related urllib tests on a build without ssl (GH-13032) 13 | These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures. 14 | 15 | Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044) 16 | 17 | Backport Co-Authored-By: Miro Hrončok 18 | --- 19 | Lib/http/client.py | 15 ++++++ 20 | Lib/test/test_urllib.py | 53 +++++++++++++++++++ 21 | Lib/test/test_xmlrpc.py | 7 ++- 22 | .../2019-04-10-08-53-30.bpo-30458.51E-DA.rst | 1 + 23 | 4 files changed, 75 insertions(+), 1 deletion(-) 24 | create mode 100644 Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst 25 | 26 | diff --git a/Lib/http/client.py b/Lib/http/client.py 27 | index 1de151c38e..2afd452fe3 100644 28 | --- a/Lib/http/client.py 29 | +++ b/Lib/http/client.py 30 | @@ -140,6 +140,16 @@ _MAXHEADERS = 100 31 | _is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*').fullmatch 32 | _is_illegal_header_value = re.compile(rb'\n(?![ \t])|\r(?![ \t\n])').search 33 | 34 | +# These characters are not allowed within HTTP URL paths. 35 | +# See https://tools.ietf.org/html/rfc3986#section-3.3 and the 36 | +# https://tools.ietf.org/html/rfc3986#appendix-A pchar definition. 37 | +# Prevents CVE-2019-9740. Includes control characters such as \r\n. 38 | +# We don't restrict chars above \x7f as putrequest() limits us to ASCII. 39 | +_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f]') 40 | +# Arguably only these _should_ allowed: 41 | +# _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$") 42 | +# We are more lenient for assumed real world compatibility purposes. 43 | + 44 | # We always set the Content-Length header for these methods because some 45 | # servers will otherwise respond with a 411 46 | _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'} 47 | @@ -1101,6 +1111,11 @@ class HTTPConnection: 48 | self._method = method 49 | if not url: 50 | url = '/' 51 | + # Prevent CVE-2019-9740. 52 | + match = _contains_disallowed_url_pchar_re.search(url) 53 | + if match: 54 | + raise InvalidURL(f"URL can't contain control characters. {url!r} " 55 | + f"(found at least {match.group()!r})") 56 | request = '%s %s %s' % (method, url, self._http_vsn_str) 57 | 58 | # Non-ASCII characters should have been eliminated earlier 59 | diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py 60 | index 2ac73b58d8..7214492eca 100644 61 | --- a/Lib/test/test_urllib.py 62 | +++ b/Lib/test/test_urllib.py 63 | @@ -329,6 +329,59 @@ class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): 64 | finally: 65 | self.unfakehttp() 66 | 67 | + @unittest.skipUnless(ssl, "ssl module required") 68 | + def test_url_with_control_char_rejected(self): 69 | + for char_no in list(range(0, 0x21)) + [0x7f]: 70 | + char = chr(char_no) 71 | + schemeless_url = f"//localhost:7777/test{char}/" 72 | + self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.") 73 | + try: 74 | + # We explicitly test urllib.request.urlopen() instead of the top 75 | + # level 'def urlopen()' function defined in this... (quite ugly) 76 | + # test suite. They use different url opening codepaths. Plain 77 | + # urlopen uses FancyURLOpener which goes via a codepath that 78 | + # calls urllib.parse.quote() on the URL which makes all of the 79 | + # above attempts at injection within the url _path_ safe. 80 | + escaped_char_repr = repr(char).replace('\\', r'\\') 81 | + InvalidURL = http.client.InvalidURL 82 | + with self.assertRaisesRegex( 83 | + InvalidURL, f"contain control.*{escaped_char_repr}"): 84 | + urllib.request.urlopen(f"http:{schemeless_url}") 85 | + with self.assertRaisesRegex( 86 | + InvalidURL, f"contain control.*{escaped_char_repr}"): 87 | + urllib.request.urlopen(f"https:{schemeless_url}") 88 | + # This code path quotes the URL so there is no injection. 89 | + resp = urlopen(f"http:{schemeless_url}") 90 | + self.assertNotIn(char, resp.geturl()) 91 | + finally: 92 | + self.unfakehttp() 93 | + 94 | + @unittest.skipUnless(ssl, "ssl module required") 95 | + def test_url_with_newline_header_injection_rejected(self): 96 | + self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.") 97 | + host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123" 98 | + schemeless_url = "//" + host + ":8080/test/?test=a" 99 | + try: 100 | + # We explicitly test urllib.request.urlopen() instead of the top 101 | + # level 'def urlopen()' function defined in this... (quite ugly) 102 | + # test suite. They use different url opening codepaths. Plain 103 | + # urlopen uses FancyURLOpener which goes via a codepath that 104 | + # calls urllib.parse.quote() on the URL which makes all of the 105 | + # above attempts at injection within the url _path_ safe. 106 | + InvalidURL = http.client.InvalidURL 107 | + with self.assertRaisesRegex( 108 | + InvalidURL, r"contain control.*\\r.*(found at least . .)"): 109 | + urllib.request.urlopen(f"http:{schemeless_url}") 110 | + with self.assertRaisesRegex(InvalidURL, r"contain control.*\\n"): 111 | + urllib.request.urlopen(f"https:{schemeless_url}") 112 | + # This code path quotes the URL so there is no injection. 113 | + resp = urlopen(f"http:{schemeless_url}") 114 | + self.assertNotIn(' ', resp.geturl()) 115 | + self.assertNotIn('\r', resp.geturl()) 116 | + self.assertNotIn('\n', resp.geturl()) 117 | + finally: 118 | + self.unfakehttp() 119 | + 120 | def test_read_0_9(self): 121 | # "0.9" response accepted (but not "simple responses" without 122 | # a status line) 123 | diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py 124 | index 32263f7f0b..0e002ec4ef 100644 125 | --- a/Lib/test/test_xmlrpc.py 126 | +++ b/Lib/test/test_xmlrpc.py 127 | @@ -945,7 +945,12 @@ class SimpleServerTestCase(BaseServerTestCase): 128 | def test_partial_post(self): 129 | # Check that a partial POST doesn't make the server loop: issue #14001. 130 | conn = http.client.HTTPConnection(ADDR, PORT) 131 | - conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye') 132 | + conn.send('POST /RPC2 HTTP/1.0\r\n' 133 | + 'Content-Length: 100\r\n\r\n' 134 | + 'bye HTTP/1.1\r\n' 135 | + f'Host: {ADDR}:{PORT}\r\n' 136 | + 'Accept-Encoding: identity\r\n' 137 | + 'Content-Length: 0\r\n\r\n'.encode('ascii')) 138 | conn.close() 139 | 140 | def test_context_manager(self): 141 | diff --git a/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst 142 | new file mode 100644 143 | index 0000000000..ed8027fb4d 144 | --- /dev/null 145 | +++ b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst 146 | @@ -0,0 +1 @@ 147 | +Address CVE-2019-9740 by disallowing URL paths with embedded whitespace or control characters through into the underlying http client request. Such potentially malicious header injection URLs now cause an http.client.InvalidURL exception to be raised. 148 | -- 149 | 2.21.0 150 | 151 | -------------------------------------------------------------------------------- /00325-CVE-2019-9948.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py 2 | index 649a5b8..0061a52 100644 3 | --- a/Lib/test/test_urllib.py 4 | +++ b/Lib/test/test_urllib.py 5 | @@ -16,6 +16,7 @@ except ImportError: 6 | ssl = None 7 | import sys 8 | import tempfile 9 | +import warnings 10 | from nturl2path import url2pathname, pathname2url 11 | 12 | from base64 import b64encode 13 | @@ -1463,6 +1464,23 @@ class URLopener_Tests(unittest.TestCase): 14 | "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"), 15 | "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/") 16 | 17 | + def test_local_file_open(self): 18 | + # bpo-35907, CVE-2019-9948: urllib must reject local_file:// scheme 19 | + class DummyURLopener(urllib.request.URLopener): 20 | + def open_local_file(self, url): 21 | + return url 22 | + 23 | + with warnings.catch_warnings(record=True): 24 | + warnings.simplefilter("ignore", DeprecationWarning) 25 | + 26 | + for url in ('local_file://example', 'local-file://example'): 27 | + self.assertRaises(OSError, urllib.request.urlopen, url) 28 | + self.assertRaises(OSError, urllib.request.URLopener().open, url) 29 | + self.assertRaises(OSError, urllib.request.URLopener().retrieve, url) 30 | + self.assertRaises(OSError, DummyURLopener().open, url) 31 | + self.assertRaises(OSError, DummyURLopener().retrieve, url) 32 | + 33 | + 34 | # Just commented them out. 35 | # Can't really tell why keep failing in windows and sparc. 36 | # Everywhere else they work ok, but on those machines, sometimes 37 | diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py 38 | index d28f2f8..c9945d9 100644 39 | --- a/Lib/urllib/request.py 40 | +++ b/Lib/urllib/request.py 41 | @@ -1747,7 +1747,7 @@ class URLopener: 42 | name = 'open_' + urltype 43 | self.type = urltype 44 | name = name.replace('-', '_') 45 | - if not hasattr(self, name): 46 | + if not hasattr(self, name) or name == 'open_local_file': 47 | if proxy: 48 | return self.open_unknown_proxy(proxy, fullurl, data) 49 | else: 50 | -------------------------------------------------------------------------------- /check-pyc-and-pyo-timestamps.py: -------------------------------------------------------------------------------- 1 | """Checks if all *.pyc and *.pyo files have later mtime than their *.py files.""" 2 | 3 | import importlib.util 4 | import os 5 | import sys 6 | 7 | # list of test and other files that we expect not to have bytecode 8 | not_compiled = [ 9 | '/usr/bin/pathfix.py', 10 | 'test/bad_coding.py', 11 | 'test/bad_coding2.py', 12 | 'test/badsyntax_3131.py', 13 | 'test/badsyntax_future3.py', 14 | 'test/badsyntax_future4.py', 15 | 'test/badsyntax_future5.py', 16 | 'test/badsyntax_future6.py', 17 | 'test/badsyntax_future7.py', 18 | 'test/badsyntax_future8.py', 19 | 'test/badsyntax_future9.py', 20 | 'test/badsyntax_future10.py', 21 | 'test/badsyntax_async1.py', 22 | 'test/badsyntax_async2.py', 23 | 'test/badsyntax_async3.py', 24 | 'test/badsyntax_async4.py', 25 | 'test/badsyntax_async5.py', 26 | 'test/badsyntax_async6.py', 27 | 'test/badsyntax_async7.py', 28 | 'test/badsyntax_async8.py', 29 | 'test/badsyntax_async9.py', 30 | 'test/badsyntax_pep3120.py', 31 | 'lib2to3/tests/data/bom.py', 32 | 'lib2to3/tests/data/crlf.py', 33 | 'lib2to3/tests/data/different_encoding.py', 34 | 'lib2to3/tests/data/false_encoding.py', 35 | 'lib2to3/tests/data/py2_test_grammar.py', 36 | '.debug-gdb.py', 37 | ] 38 | failed = 0 39 | 40 | 41 | def bytecode_expected(source): 42 | for f in not_compiled: 43 | if source.endswith(f): 44 | return False 45 | return True 46 | 47 | 48 | compiled = filter(lambda f: bytecode_expected(f), sys.argv[1:]) 49 | for f in compiled: 50 | # check both pyo and pyc 51 | to_check = map(lambda b: importlib.util.cache_from_source(f, b), (True, False)) 52 | f_mtime = os.path.getmtime(f) 53 | for c in to_check: 54 | c_mtime = os.path.getmtime(c) 55 | if c_mtime < f_mtime: 56 | sys.stderr.write('Failed bytecompilation timestamps check: ') 57 | sys.stderr.write('Bytecode file {} is older than source file {}.\n'.format(c, f)) 58 | failed += 1 59 | 60 | if failed: 61 | sys.stderr.write('\n{} files failed bytecompilation timestamps check.\n'.format(failed)) 62 | sys.exit(1) 63 | -------------------------------------------------------------------------------- /idle3.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | idle3.desktop 6 | IDLE3 7 | CC0 8 | Python-2.0 9 | Python 3 Integrated Development and Learning Environment 10 | 11 |

12 | IDLE is Python’s Integrated Development and Learning Environment. 13 | The GUI is uniform between Windows, Unix, and Mac OS X. 14 | IDLE provides an easy way to start writing, running, and debugging 15 | Python code. 16 |

17 |

18 | IDLE is written in pure Python, and uses the tkinter GUI toolkit. 19 | It provides: 20 |

21 |
    22 |
  • a Python shell window (interactive interpreter) with colorizing of code input, output, and error messages,
  • 23 |
  • a multi-window text editor with multiple undo, Python colorizing, smart indent, call tips, auto completion, and other features,
  • 24 |
  • search within any window, replace within editor windows, and search through multiple files (grep),
  • 25 |
  • a debugger with persistent breakpoints, stepping, and viewing of global and local namespaces.
  • 26 |
27 |
28 | https://docs.python.org/3/library/idle.html 29 | 30 | http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-main-window.png 31 | http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-class-browser.png 32 | http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-code-viewer.png 33 | 34 | zbyszek@in.waw.pl 35 |
36 | -------------------------------------------------------------------------------- /idle3.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=IDLE 3 4 | Comment=Python 3 Integrated Development and Learning Environment 5 | Exec=idle3 %F 6 | TryExec=idle3 7 | Terminal=false 8 | Type=Application 9 | Icon=idle3 10 | Categories=Development;IDE; 11 | MimeType=text/x-python; -------------------------------------------------------------------------------- /python36.spec: -------------------------------------------------------------------------------- 1 | # ================== 2 | # Top-level metadata 3 | # ================== 4 | 5 | Name: python36 6 | Summary: Interpreter of the Python programming language 7 | URL: https://www.python.org/ 8 | 9 | %global pybasever 3.6 10 | 11 | # pybasever without the dot: 12 | %global pyshortver 36 13 | 14 | # is this the EPEL 7 main Python 3? 15 | %if "%python3_pkgversion" == "%pyshortver" 16 | %global main_python3 1 17 | %else 18 | %global main_python3 0 19 | %endif 20 | 21 | Version: %{pybasever}.8 22 | Release: 2%{?dist} 23 | License: Python 24 | 25 | 26 | # ================================== 27 | # Conditionals controlling the build 28 | # ================================== 29 | 30 | # Note that the bcond macros are named for the CLI option they create. 31 | # "%%bcond_without" means "ENABLE by default and create a --without option" 32 | 33 | # Expensive optimizations (mainly, profile-guided optimizations) 34 | %ifarch %{ix86} x86_64 35 | %bcond_without optimizations 36 | %else 37 | # On some architectures, the optimized build takes tens of hours, possibly 38 | # longer than Koji's 24-hour timeout. Disable optimizations here. 39 | %bcond_with optimizations 40 | %endif 41 | 42 | # Run the test suite in %%check 43 | %bcond_without tests 44 | 45 | # Extra build for debugging the interpreter or C-API extensions 46 | # (the -debug subpackages) 47 | %bcond_without debug_build 48 | 49 | # Support for the GDB debugger 50 | %bcond_without gdb_hooks 51 | 52 | # The dbm.gnu module (key-value database) 53 | %bcond_without gdbm 54 | 55 | # Main interpreter loop optimization 56 | %bcond_without computed_gotos 57 | 58 | # Support for the Valgrind debugger/profiler 59 | %ifnarch s390 %{mips} riscv64 60 | %bcond_without valgrind 61 | %else 62 | # Some arches don't have valgrind, disable support for it there. 63 | %bcond_with valgrind 64 | %endif 65 | 66 | 67 | # ===================== 68 | # General global macros 69 | # ===================== 70 | 71 | %global pylibdir %{_libdir}/python%{pybasever} 72 | %global dynload_dir %{pylibdir}/lib-dynload 73 | 74 | # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac 75 | # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/ 76 | %global ABIFLAGS_optimized m 77 | %global ABIFLAGS_debug dm 78 | 79 | %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} 80 | %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} 81 | 82 | %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} 83 | %global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} 84 | 85 | # All bytecode files are in a __pycache__ subdirectory, with a name 86 | # reflecting the version of the bytecode. 87 | # See PEP 3147: http://www.python.org/dev/peps/pep-3147/ 88 | # For example, 89 | # foo/bar.py 90 | # has bytecode at: 91 | # foo/__pycache__/bar.cpython-%%{pyshortver}.pyc 92 | # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc 93 | # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc 94 | %global bytecode_suffixes .cpython-%{pyshortver}*.pyc 95 | 96 | # Python's configure script defines SOVERSION, and this is used in the Makefile 97 | # to determine INSTSONAME, the name of the libpython DSO: 98 | # LDLIBRARY='libpython$(VERSION).so' 99 | # INSTSONAME="$LDLIBRARY".$SOVERSION 100 | # We mirror this here in order to make it easier to add the -gdb.py hooks. 101 | # (if these get out of sync, the payload of the libs subpackage will fail 102 | # and halt the build) 103 | %global py_SOVERSION 1.0 104 | %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} 105 | %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} 106 | 107 | # We want to byte-compile the .py files within the packages using the new 108 | # python3 binary. 109 | # 110 | # Unfortunately, rpmbuild's infrastructure requires us to jump through some 111 | # hoops to avoid byte-compiling with the system python version: 112 | # /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things) 113 | # defines __os_install_post. In particular, "brp-python-bytecompile" is 114 | # invoked without an argument thus using the wrong version of python 115 | # (/usr/bin/python, rather than the freshly built python), thus leading to 116 | # numerous syntax errors, and incorrect magic numbers in the .pyc files. We 117 | # thus override __os_install_post to avoid invoking this script: 118 | %global __os_install_post /usr/lib/rpm/brp-compress \ 119 | %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ 120 | /usr/lib/rpm/brp-strip-static-archive %{__strip} \ 121 | /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ 122 | /usr/lib/rpm%{?el6:/redhat}/brp-python-hardlink 123 | # to remove the invocation of brp-python-bytecompile, whilst keeping the 124 | # invocation of brp-python-hardlink (since this should still work for python3 125 | # pyc files) 126 | 127 | # For multilib support, files that are different between 32- and 64-bit arches 128 | # need different filenames. Use "64" or "32" according to the word size. 129 | # Currently, the best way to determine an architecture's word size happens to 130 | # be checking %%{_lib}. 131 | %if "%{_lib}" == "lib64" 132 | %global wordsize 64 133 | %else 134 | %global wordsize 32 135 | %endif 136 | 137 | 138 | # ======================= 139 | # Build-time requirements 140 | # ======================= 141 | 142 | # (keep this list alphabetized) 143 | 144 | BuildRequires: autoconf%{?el6:268} 145 | BuildRequires: bluez-libs-devel 146 | BuildRequires: bzip2 147 | BuildRequires: bzip2-devel 148 | %if 0%{?main_python3} 149 | BuildRequires: desktop-file-utils 150 | %endif 151 | 152 | # expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use 153 | # it (in pyexpat) in order to enable the fix in Python-3.2.3 for CVE-2012-0876: 154 | %if %{defined el6} 155 | # Also backported to el6: https://access.redhat.com/errata/RHSA-2012:0731 156 | BuildRequires: expat-devel >= 2.0.1-11.el6_2 157 | %else 158 | BuildRequires: expat-devel >= 2.1.0 159 | %endif 160 | 161 | BuildRequires: findutils 162 | BuildRequires: gcc-c++ 163 | %if %{with gdbm} 164 | BuildRequires: gdbm-devel 165 | %endif 166 | BuildRequires: glibc-devel 167 | BuildRequires: gmp-devel 168 | %if 0%{?main_python3} && %{undefined el6} 169 | BuildRequires: libappstream-glib 170 | %endif 171 | BuildRequires: libffi-devel 172 | BuildRequires: libGL-devel 173 | BuildRequires: libX11-devel 174 | BuildRequires: ncurses-devel 175 | 176 | BuildRequires: openssl-devel 177 | BuildRequires: pkgconfig 178 | BuildRequires: readline-devel 179 | BuildRequires: sqlite-devel 180 | BuildRequires: gdb 181 | 182 | BuildRequires: tar 183 | BuildRequires: tcl-devel 184 | BuildRequires: tix-devel 185 | BuildRequires: tk-devel 186 | 187 | %if %{with valgrind} 188 | BuildRequires: valgrind-devel 189 | %endif 190 | 191 | BuildRequires: xz-devel 192 | BuildRequires: zlib-devel 193 | 194 | BuildRequires: /usr/bin/dtrace 195 | 196 | # workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) 197 | BuildRequires: net-tools 198 | 199 | 200 | # ======================= 201 | # Source code and patches 202 | # ======================= 203 | 204 | Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz 205 | 206 | # A simple script to check timestamps of bytecode files 207 | # Run in check section with Python that is currently being built 208 | # Written by bkabrda 209 | Source8: check-pyc-and-pyo-timestamps.py 210 | 211 | # Desktop menu entry for idle3 212 | Source10: idle3.desktop 213 | 214 | # AppData file for idle3 215 | Source11: idle3.appdata.xml 216 | 217 | # 00001 # 218 | # Fixup distutils/unixccompiler.py to remove standard library path from rpath: 219 | # Was Patch0 in ivazquez' python3000 specfile: 220 | Patch1: 00001-rpath.patch 221 | 222 | # 00102 # 223 | # Change the various install paths to use /usr/lib64/ instead or /usr/lib 224 | # Only used when "%%{_lib}" == "lib64" 225 | # Not yet sent upstream. 226 | Patch102: 00102-lib64.patch 227 | 228 | # 00111 # 229 | # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build 230 | # a libpythonMAJOR.MINOR.a 231 | # See https://bugzilla.redhat.com/show_bug.cgi?id=556092 232 | # Downstream only: not appropriate for upstream 233 | Patch111: 00111-no-static-lib.patch 234 | 235 | # 00132 # 236 | # Add non-standard hooks to unittest for use in the "check" phase below, when 237 | # running selftests within the build: 238 | # @unittest._skipInRpmBuild(reason) 239 | # for tests that hang or fail intermittently within the build environment, and: 240 | # @unittest._expectedFailureInRpmBuild 241 | # for tests that always fail within the build environment 242 | # 243 | # The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the 244 | # environment, which we set manually in the appropriate portion of the "check" 245 | # phase below (and which potentially other python-* rpms could set, to reuse 246 | # these unittest hooks in their own "check" phases) 247 | Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch 248 | 249 | # 00155 # 250 | # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid 251 | # generating SELinux denials on "import ctypes" and "import uuid" when 252 | # embedding Python within httpd 253 | # See https://bugzilla.redhat.com/show_bug.cgi?id=814391 254 | Patch155: 00155-avoid-ctypes-thunks.patch 255 | 256 | # 00160 # 257 | # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the 258 | # header files in the build chroot, but may not be supported in the running 259 | # kernel, hence we disable this test in an rpm build. 260 | # Adding these was upstream issue http://bugs.python.org/issue10142 261 | # Not yet sent upstream 262 | Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch 263 | 264 | # 00163 # 265 | # Some tests within test_socket fail intermittently when run inside Koji; 266 | # disable them using unittest._skipInRpmBuild 267 | # Not yet sent upstream 268 | Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch 269 | 270 | # 00170 # 271 | # In debug builds, try to print repr() when a C-level assert fails in the 272 | # garbage collector (typically indicating a reference-counting error 273 | # somewhere else e.g in an extension module) 274 | # The new macros/functions within gcmodule.c are hidden to avoid exposing 275 | # them within the extension API. 276 | # Sent upstream: http://bugs.python.org/issue9263 277 | # See https://bugzilla.redhat.com/show_bug.cgi?id=614680 278 | Patch170: 00170-gc-assertions.patch 279 | 280 | # 00178 # 281 | # Don't duplicate various FLAGS in sysconfig values 282 | # http://bugs.python.org/issue17679 283 | # Does not affect python2 AFAICS (different sysconfig values initialization) 284 | Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch 285 | 286 | # 00205 # 287 | # LIBPL variable in makefile takes LIBPL from configure.ac 288 | # but the LIBPL variable defined there doesn't respect libdir macro 289 | Patch205: 00205-make-libpl-respect-lib64.patch 290 | 291 | # 00251 292 | # Set values of prefix and exec_prefix in distutils install command 293 | # to /usr/local if executable is /usr/bin/python* and RPM build 294 | # is not detected to make pip and distutils install into separate location 295 | # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe 296 | Patch251: 00251-change-user-install-location.patch 297 | 298 | # 00262 # 299 | # Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale 300 | # https://www.python.org/dev/peps/pep-0538/ 301 | # Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale 302 | # Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 303 | Patch262: 00262-pep538_coerce_legacy_c_locale.patch 304 | 305 | # 00274 # 306 | # Upstream uses Debian-style architecture naming. Change to match Fedora. 307 | Patch274: 00274-fix-arch-names.patch 308 | 309 | # 00292 # 310 | # Restore the public PyExc_RecursionErrorInst symbol that was removed 311 | # from the 3.6.4 release upstream. 312 | # Reported upstream: https://bugs.python.org/issue30697 313 | Patch292: 00292-restore-PyExc_RecursionErrorInst-symbol.patch 314 | 315 | # 00294 # 316 | # Define TLS cipher suite on build time depending 317 | # on the OpenSSL default cipher suite selection. 318 | # Fixed upstream on CPython's 3.7 branch: 319 | # https://bugs.python.org/issue31429 320 | # See also: https://bugzilla.redhat.com/show_bug.cgi?id=1489816 321 | Patch294: 00294-define-TLS-cipher-suite-on-build-time.patch 322 | 323 | # 00316 # 324 | # We remove the exe files from distutil's bdist_wininst 325 | # So we mark the command as unsupported - and the tests are skipped 326 | Patch316: 00316-mark-bdist_wininst-unsupported.patch 327 | 328 | # 00317 # 329 | # Security fix for CVE-2019-5010: Fix segfault in ssl's cert parser 330 | # Fixed upstream https://bugs.python.org/issue35746 331 | Patch317: 00317-CVE-2019-5010.patch 332 | 333 | # 00320 # 334 | # Security fix for CVE-2019-9636 and CVE-2019-10160: Information Disclosure due to urlsplit improper NFKC normalization 335 | # Fixed upstream: https://bugs.python.org/issue36216 and https://bugs.python.org/issue36742 336 | # Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1696755 337 | # and https://bugzilla.redhat.com/show_bug.cgi?id=1718403 338 | Patch320: 00320-CVE-2019-9636-and-CVE-2019-10160.patch 339 | 340 | # 00324 # 341 | # Disallow control chars in http URLs 342 | # Security fix for CVE-2019-9740 and CVE-2019-9947 343 | # Fixed upstream: https://bugs.python.org/issue30458 344 | # Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1703535 345 | # and https://bugzilla.redhat.com/show_bug.cgi?id=1704364 346 | Patch324: 00324-disallow-control-chars-in-http-urls.patch 347 | 348 | # 00325 # 349 | # Unnecessary URL scheme exists to allow local_file:// reading file in urllib 350 | # Security fix for CVE-2019-9948 351 | # Fixed upstream: https://bugs.python.org/issue35907 352 | # Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1714642 353 | Patch325: 00325-CVE-2019-9948.patch 354 | 355 | # (New patches go here ^^^) 356 | # 357 | # When adding new patches to "python" and "python3" in Fedora, EL, etc., 358 | # please try to keep the patch numbers in-sync between all specfiles. 359 | # 360 | # More information, and a patch number catalog, is at: 361 | # 362 | # https://fedoraproject.org/wiki/SIGs/Python/PythonPatches 363 | 364 | 365 | # ========================================== 366 | # Descriptions, and metadata for subpackages 367 | # ========================================== 368 | 369 | # Packages with Python modules in standard locations automatically 370 | # depend on python(abi). Provide that here. 371 | Provides: python(abi) = %{pybasever} 372 | 373 | # We keep those inside on purpose 374 | Provides: bundled(python3-pip) = 18.1 375 | Provides: bundled(python3-setuptools) = 40.6.2 376 | 377 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} 378 | 379 | # Rename from python36u 380 | Provides: python36u = %{version}-%{release} 381 | Provides: python36u%{?_isa} = %{version}-%{release} 382 | Obsoletes: python36u < 3.6.8-2 383 | 384 | %if 0%{?main_python3} 385 | # /usr/bin/python3 was moved from here: 386 | Obsoletes: python34 < 3.4.9-3 387 | %endif 388 | 389 | # This prevents ALL subpackages built from this spec to require 390 | # /usr/bin/python3*. Granularity per subpackage is impossible. 391 | # It's intended for the libs package not to drag in the interpreter, see 392 | # https://bugzilla.redhat.com/show_bug.cgi?id=1547131 393 | # All others require %%{name} anyway. 394 | %global __requires_exclude ^/usr/bin/python3 395 | 396 | 397 | # The description used both for the SRPM and the main `python3` subpackage: 398 | %description 399 | Python is an accessible, high-level, dynamically typed, interpreted programming 400 | language, designed with an emphasis on code readability. 401 | It includes an extensive standard library, and has a vast ecosystem of 402 | third-party libraries. 403 | 404 | The %{name} package provides the "python3" executable: the reference 405 | interpreter for the Python language, version 3. 406 | The majority of its standard library is provided in the %{name}-libs package, 407 | which should be installed automatically along with %{name}. 408 | The remaining parts of the Python standard library are broken out into the 409 | %{name}-tkinter and %{name}-test packages, which may need to be installed 410 | separately. 411 | 412 | Documentation for Python is provided in the %{name}-docs package. 413 | 414 | Packages containing additional libraries for Python are generally named with 415 | the "%{name}-" prefix. 416 | 417 | 418 | %package libs 419 | Summary: Python runtime libraries 420 | 421 | # expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use 422 | # this symbol (in pyexpat), so we must explicitly state this dependency to 423 | # prevent "import pyexpat" from failing with a linker error if someone hasn't 424 | # yet upgraded expat: 425 | %if %{defined el6} 426 | # Also backported to el6: https://access.redhat.com/errata/RHSA-2012:0731 427 | Requires: expat >= 2.0.1-11.el6_2 428 | %else 429 | Requires: expat >= 2.1.0 430 | %endif 431 | 432 | # Rename from python36u-libs 433 | Provides: python36u-libs = %{version}-%{release} 434 | Provides: python36u-libs%{?_isa} = %{version}-%{release} 435 | Obsoletes: python36u-libs < 3.6.8-2 436 | 437 | %if 0%{?main_python3} 438 | # libpython3.so was moved from here: 439 | Obsoletes: python34-libs < 3.4.9-3 440 | %endif 441 | 442 | 443 | %description libs 444 | This package contains runtime libraries for use by Python: 445 | - the majority of the Python standard library 446 | - a dynamically linked library for use by applications that embed Python as 447 | a scripting language, and by the main "python3" executable 448 | 449 | 450 | %package devel 451 | Summary: Libraries and header files needed for Python development 452 | Requires: %{name} = %{version}-%{release} 453 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} 454 | BuildRequires: python-rpm-macros 455 | Requires: python-rpm-macros 456 | Requires: python3-rpm-macros 457 | 458 | # https://bugzilla.redhat.com/show_bug.cgi?id=1217376 459 | # https://bugzilla.redhat.com/show_bug.cgi?id=1496757 460 | # https://bugzilla.redhat.com/show_bug.cgi?id=1218294 461 | # TODO change to a specific subpackage once available (#1218294) 462 | Requires: redhat-rpm-config 463 | 464 | # Rename from python36u-devel 465 | Provides: python36u-devel = %{version}-%{release} 466 | Provides: python36u-devel%{?_isa} = %{version}-%{release} 467 | Obsoletes: python36u-devel < 3.6.8-2 468 | 469 | Provides: %{name}-2to3 = %{version}-%{release} 470 | 471 | Conflicts: %{name} < %{version}-%{release} 472 | 473 | %if 0%{?main_python3} 474 | # /usr/bin/2to3-3 was moved from here: 475 | Obsoletes: python34-tools < 3.4.9-3 476 | # /usr/bin/python3-config was moved from here: 477 | Obsoletes: python34-devel < 3.4.9-3 478 | %endif 479 | 480 | 481 | %description devel 482 | This package contains the header files and configuration needed to compile 483 | Python extension modules (typically written in C or C++), to embed Python 484 | into other programs, and to make binary distributions for Python libraries. 485 | 486 | It also contains the necessary macros to build RPM packages with Python modules 487 | and 2to3 tool, an automatic source converter from Python 2.X. 488 | 489 | 490 | %package idle 491 | Summary: A basic graphical development environment for Python 492 | Requires: %{name} = %{version}-%{release} 493 | Requires: %{name}-tkinter = %{version}-%{release} 494 | 495 | Provides: %{name}-tools = %{version}-%{release} 496 | Provides: %{name}-tools%{?_isa} = %{version}-%{release} 497 | Obsoletes: %{name}-tools < %{version}-%{release} 498 | 499 | # Rename from python36u-tools 500 | Provides: python36u-tools = %{version}-%{release} 501 | Provides: python36u-tools%{?_isa} = %{version}-%{release} 502 | Obsoletes: python36u-tools < 3.6.8-2 503 | 504 | %if 0%{?main_python3} 505 | # /usr/bin/idle3 was moved from here: 506 | Obsoletes: python34-tools < 3.4.9-3 507 | %endif 508 | 509 | 510 | %description idle 511 | IDLE is Python’s Integrated Development and Learning Environment. 512 | 513 | IDLE has the following features: Python shell window (interactive 514 | interpreter) with colorizing of code input, output, and error messages; 515 | multi-window text editor with multiple undo, Python colorizing, 516 | smart indent, call tips, auto completion, and other features; 517 | search within any window, replace within editor windows, and 518 | search through multiple files (grep); debugger with persistent 519 | breakpoints, stepping, and viewing of global and local namespaces; 520 | configuration, browsers, and other dialogs. 521 | 522 | 523 | %package tkinter 524 | Summary: A GUI toolkit for Python 525 | Requires: %{name} = %{version}-%{release} 526 | 527 | # Rename from python36u-tkinter 528 | Provides: python36u-tkinter = %{version}-%{release} 529 | Provides: python36u-tkinter%{?_isa} = %{version}-%{release} 530 | Obsoletes: python36u-tkinter < 3.6.8-2 531 | 532 | 533 | %description tkinter 534 | The Tkinter (Tk interface) library is a graphical user interface toolkit for 535 | the Python programming language. 536 | 537 | 538 | %package test 539 | Summary: The self-test suite for the main python3 package 540 | Requires: %{name} = %{version}-%{release} 541 | 542 | # Rename from python36u-test 543 | Provides: python36u-test = %{version}-%{release} 544 | Provides: python36u-test%{?_isa} = %{version}-%{release} 545 | Obsoletes: python36u-test < 3.6.8-2 546 | 547 | 548 | %description test 549 | The self-test suite for the Python interpreter. 550 | 551 | This is only useful to test Python itself. For testing general Python code, 552 | you should use the unittest module from %{name}-libs, or a library such as 553 | %{name}-pytest or %{name}-nose. 554 | 555 | 556 | %if %{with debug_build} 557 | %package debug 558 | Summary: Debug version of the Python runtime 559 | 560 | # The debug build is an all-in-one package version of the regular build, and 561 | # shares the same .py/.pyc files and directories as the regular build. Hence 562 | # we depend on all of the subpackages of the regular build: 563 | Requires: %{name}%{?_isa} = %{version}-%{release} 564 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} 565 | Requires: %{name}-devel%{?_isa} = %{version}-%{release} 566 | Requires: %{name}-test%{?_isa} = %{version}-%{release} 567 | Requires: %{name}-tkinter%{?_isa} = %{version}-%{release} 568 | Requires: %{name}-idle%{?_isa} = %{version}-%{release} 569 | 570 | # Rename from python36u-debug 571 | Provides: python36u-debug = %{version}-%{release} 572 | Provides: python36u-debug%{?_isa} = %{version}-%{release} 573 | Obsoletes: python36u-debug < 3.6.8-2 574 | 575 | %if 0%{?main_python3} 576 | # /usr/bin/python3-debug was moved from here: 577 | Obsoletes: python34-debug < 3.4.9-3 578 | %endif 579 | 580 | 581 | %description debug 582 | python3-debug provides a version of the Python runtime with numerous debugging 583 | features enabled, aimed at advanced Python users such as developers of Python 584 | extension modules. 585 | 586 | This version uses more memory and will be slower than the regular Python build, 587 | but is useful for tracking down reference-counting issues and other bugs. 588 | 589 | The bytecode format is unchanged, so that .pyc files are compatible between 590 | this and the standard version of Python, but the debugging features mean that 591 | C/C++ extension modules are ABI-incompatible and must be built for each version 592 | separately. 593 | 594 | The debug build shares installation directories with the standard Python 595 | runtime, so that .py and .pyc files can be shared. 596 | Compiled extension modules use a special ABI flag ("d") in the filename, 597 | so extensions for both versions can co-exist in the same directory. 598 | %endif # with debug_build 599 | 600 | 601 | # ====================================================== 602 | # The prep phase of the build: 603 | # ====================================================== 604 | 605 | %prep 606 | %setup -q -n Python-%{version}%{?prerel} 607 | # Remove all exe files to ensure we are not shipping prebuilt binaries 608 | # note that those are only used to create Microsoft Windows installers 609 | # and that functionality is broken on Linux anyway 610 | find -name '*.exe' -print -delete 611 | 612 | # Remove bundled libraries to ensure that we're using the system copy. 613 | rm -r Modules/expat 614 | rm -r Modules/zlib 615 | 616 | # 617 | # Apply patches: 618 | # 619 | %patch1 -p1 620 | 621 | %if "%{_lib}" == "lib64" 622 | %patch102 -p1 623 | %endif 624 | %patch111 -p1 625 | %patch132 -p1 626 | %patch155 -p1 627 | %patch160 -p1 628 | %patch163 -p1 629 | %patch170 -p1 630 | %patch178 -p1 631 | %patch205 -p1 632 | %patch251 -p1 633 | %patch262 -p1 634 | %patch274 -p1 635 | %patch292 -p1 636 | %patch294 -p1 637 | %patch316 -p1 638 | %patch317 -p1 639 | %patch320 -p1 640 | %patch324 -p1 641 | %patch325 -p1 642 | 643 | # Remove files that should be generated by the build 644 | # (This is after patching, so that we can use patches directly from upstream) 645 | rm configure pyconfig.h.in 646 | 647 | 648 | # ====================================================== 649 | # Configuring and building the code: 650 | # ====================================================== 651 | 652 | %build 653 | 654 | # Regenerate the configure script and pyconfig.h.in 655 | autoconf%{?el6:268} 656 | autoheader%{?el6:268} 657 | 658 | # Remember the current directory (which has sources and the configure script), 659 | # so we can refer to it after we "cd" elsewhere. 660 | topdir=$(pwd) 661 | 662 | # Get proper option names from bconds 663 | %if %{with computed_gotos} 664 | %global computed_gotos_flag yes 665 | %else 666 | %global computed_gotos_flag no 667 | %endif 668 | 669 | %if %{with optimizations} 670 | %global optimizations_flag "--enable-optimizations" 671 | %else 672 | %global optimizations_flag "--disable-optimizations" 673 | %endif 674 | 675 | # Set common compiler/linker flags 676 | export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" 677 | export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" 678 | export CPPFLAGS="$(pkg-config --cflags-only-I libffi)" 679 | export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" 680 | export LINKCC="gcc" 681 | export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)" 682 | export LDFLAGS="$RPM_LD_FLAGS -g $(pkg-config --libs-only-L openssl)" 683 | 684 | # We can build several different configurations of Python: regular and debug. 685 | # Define a common function that does one build: 686 | BuildPython() { 687 | ConfName=$1 688 | ExtraConfigArgs=$2 689 | MoreCFlags=$3 690 | 691 | # Each build is done in its own directory 692 | ConfDir=build/$ConfName 693 | echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName 694 | mkdir -p $ConfDir 695 | pushd $ConfDir 696 | 697 | # Normally, %%configure looks for the "configure" script in the current 698 | # directory. 699 | # Since we changed directories, we need to tell %%configure where to look. 700 | %global _configure $topdir/configure 701 | 702 | %configure \ 703 | --enable-ipv6 \ 704 | --enable-shared \ 705 | --with-computed-gotos=%{computed_gotos_flag} \ 706 | --with-dbmliborder=gdbm:ndbm:bdb \ 707 | --with-system-expat \ 708 | --with-system-ffi \ 709 | --enable-loadable-sqlite-extensions \ 710 | --with-dtrace \ 711 | --with-ssl-default-suites=openssl \ 712 | %if %{with valgrind} 713 | --with-valgrind \ 714 | %endif 715 | $ExtraConfigArgs \ 716 | %{nil} 717 | 718 | # Invoke the build 719 | make EXTRA_CFLAGS="$CFLAGS $MoreCFlags" %{?_smp_mflags} 720 | 721 | popd 722 | echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName 723 | } 724 | 725 | # Call the above to build each configuration. 726 | 727 | %if %{with debug_build} 728 | BuildPython debug \ 729 | "--without-ensurepip --with-pydebug" \ 730 | "-O0" 731 | %endif # with debug_build 732 | 733 | BuildPython optimized \ 734 | "--without-ensurepip %{optimizations_flag}" \ 735 | "" 736 | 737 | 738 | # ====================================================== 739 | # Installing the built code: 740 | # ====================================================== 741 | 742 | %install 743 | 744 | # As in %%build, remember the current directory 745 | topdir=$(pwd) 746 | 747 | # We install a collection of hooks for gdb that make it easier to debug 748 | # executables linked against libpython3* (such as /usr/bin/python3 itself) 749 | # 750 | # These hooks are implemented in Python itself (though they are for the version 751 | # of python that gdb is linked with) 752 | # 753 | # gdb-archer looks for them in the same path as the ELF file or its .debug 754 | # file, with a -gdb.py suffix. 755 | # We put them next to the debug file, because ldconfig would complain if 756 | # it found non-library files directly in /usr/lib/ 757 | # (see https://bugzilla.redhat.com/show_bug.cgi?id=562980) 758 | # 759 | # We'll put these files in the debuginfo package by installing them to e.g.: 760 | # /usr/lib/debug/usr/lib/libpython3.2.so.1.0.debug-gdb.py 761 | # (note that the debug path is /usr/lib/debug for both 32/64 bit) 762 | # 763 | # See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more 764 | # information 765 | 766 | %if %{with gdb_hooks} 767 | DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} 768 | mkdir -p %{buildroot}$DirHoldingGdbPy 769 | %endif # with gdb_hooks 770 | 771 | # Multilib support for pyconfig.h 772 | # 32- and 64-bit versions of pyconfig.h are different. For multilib support 773 | # (making it possible to install 32- and 64-bit versions simultaneously), 774 | # we need to install them under different filenames, and to make the common 775 | # "pyconfig.h" include the right file based on architecture. 776 | # See https://bugzilla.redhat.com/show_bug.cgi?id=192747 777 | # Filanames are defined here: 778 | %global _pyconfig32_h pyconfig-32.h 779 | %global _pyconfig64_h pyconfig-64.h 780 | %global _pyconfig_h pyconfig-%{wordsize}.h 781 | 782 | # Use a common function to do an install for all our configurations: 783 | InstallPython() { 784 | 785 | ConfName=$1 786 | PyInstSoName=$2 787 | MoreCFlags=$3 788 | LDVersion=$4 789 | 790 | # Switch to the directory with this configuration's built files 791 | ConfDir=build/$ConfName 792 | echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName 793 | mkdir -p $ConfDir 794 | pushd $ConfDir 795 | 796 | make \ 797 | DESTDIR=%{buildroot} \ 798 | INSTALL="install -p" \ 799 | EXTRA_CFLAGS="$MoreCFlags" \ 800 | %if 0%{?main_python3} 801 | install 802 | %else 803 | altinstall 804 | %endif 805 | 806 | popd 807 | 808 | %if %{with gdb_hooks} 809 | # See comment on $DirHoldingGdbPy above 810 | PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py 811 | cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy 812 | %endif # with gdb_hooks 813 | 814 | # Rename the -devel script that differs on different arches to arch specific name 815 | mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config 816 | echo -e '#!/bin/sh\nexec `dirname $0`/python'${LDVersion}'-`uname -m`-config "$@"' > \ 817 | %{buildroot}%{_bindir}/python${LDVersion}-config 818 | echo '[ $? -eq 127 ] && echo "Could not find python'${LDVersion}'-`uname -m`-config. Look around to see available arches." >&2' >> \ 819 | %{buildroot}%{_bindir}/python${LDVersion}-config 820 | chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config 821 | 822 | # Make python3-devel multilib-ready 823 | mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \ 824 | %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h} 825 | cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF 826 | #include 827 | 828 | #if __WORDSIZE == 32 829 | #include "%{_pyconfig32_h}" 830 | #elif __WORDSIZE == 64 831 | #include "%{_pyconfig64_h}" 832 | #else 833 | #error "Unknown word size" 834 | #endif 835 | EOF 836 | 837 | echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName 838 | } 839 | 840 | # Install the "debug" build first; any common files will be overridden with 841 | # later builds 842 | %if %{with debug_build} 843 | InstallPython debug \ 844 | %{py_INSTSONAME_debug} \ 845 | -O0 \ 846 | %{LDVERSION_debug} 847 | 848 | %if ! 0%{?main_python3} 849 | # altinstall only creates pkgconfig/python-3.6.pc, not the version with ABIFAGS, 850 | # so we need to move the debug .pc file to not overwrite it by optimized install 851 | mv \ 852 | %{buildroot}%{_libdir}/pkgconfig/python-%{pybasever}.pc \ 853 | %{buildroot}%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc 854 | %endif 855 | 856 | %endif # with debug_build 857 | 858 | # Now the optimized build: 859 | InstallPython optimized \ 860 | %{py_INSTSONAME_optimized} \ 861 | "" \ 862 | %{LDVERSION_optimized} 863 | 864 | # Install directories for additional packages 865 | install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ 866 | %if "%{_lib}" == "lib64" 867 | # The 64-bit version needs to create "site-packages" in /usr/lib/ (for 868 | # pure-Python modules) as well as in /usr/lib64/ (for packages with extension 869 | # modules). 870 | # Note that rpmlint will complain about hardcoded library path; 871 | # this is intentional. 872 | install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ 873 | %endif 874 | 875 | %if 0%{main_python3} 876 | # add idle3 to menu if that is the main python3 in EPEL 877 | install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png 878 | install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png 879 | install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png 880 | desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} 881 | 882 | %if %{undefined el6} 883 | # Install and validate appdata file 884 | mkdir -p %{buildroot}%{_datadir}/appdata 885 | cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata 886 | appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml 887 | %endif 888 | %endif 889 | 890 | %if 0%{main_python3} 891 | mv %{buildroot}%{_bindir}/2to3 %{buildroot}%{_bindir}/2to3-3 892 | %endif 893 | 894 | # Make sure distutils looks at the right pyconfig.h file 895 | # See https://bugzilla.redhat.com/show_bug.cgi?id=201434 896 | # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate 897 | # pyconfig.h so it can be parsed, and needs to do this at runtime in site.py 898 | # when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058) 899 | # 900 | # Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h 901 | # variants: 902 | sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \ 903 | %{buildroot}%{pylibdir}/distutils/sysconfig.py \ 904 | %{buildroot}%{pylibdir}/sysconfig.py 905 | 906 | # Install pathfix.py to bindir 907 | # See https://github.com/fedora-python/python-rpm-porting/issues/24 908 | cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/ 909 | 910 | # Switch all shebangs to refer to the specific Python version. 911 | # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, 912 | # so handle files named using other naming scheme separately. 913 | LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ 914 | Tools/scripts/pathfix.py \ 915 | -i "%{_bindir}/python%{pybasever}" -pn \ 916 | %{buildroot} \ 917 | %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py} 918 | 919 | # Remove tests for python3-tools which was removed in 920 | # https://bugzilla.redhat.com/show_bug.cgi?id=1312030 921 | rm -rf %{buildroot}%{pylibdir}/test/test_tools 922 | 923 | # Remove shebang lines from .py files that aren't executable, and 924 | # remove executability from .py files that don't have a shebang line: 925 | find %{buildroot} -name \*.py \ 926 | \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \ 927 | -print -exec sed -i '1d' {} \; \) -o \( \ 928 | -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ 929 | -exec chmod a-x {} \; \) \) 930 | 931 | # Get rid of DOS batch files: 932 | find %{buildroot} -name \*.bat -exec rm {} \; 933 | 934 | # Get rid of backup files: 935 | find %{buildroot}/ -name "*~" -exec rm -f {} \; 936 | find . -name "*~" -exec rm -f {} \; 937 | 938 | # Get rid of a stray copy of the license: 939 | rm %{buildroot}%{pylibdir}/LICENSE.txt 940 | 941 | # Do bytecompilation with the newly installed interpreter. 942 | # This is similar to the script in macros.pybytecompile 943 | # compile *.pyc 944 | find %{buildroot} -type f -a -name "*.py" -print0 | \ 945 | LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ 946 | PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ 947 | xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || : 948 | 949 | # Since we have pathfix.py in bindir, this is created, but we don't want it 950 | rm -rf %{buildroot}%{_bindir}/__pycache__ 951 | 952 | # Fixup permissions for shared libraries from non-standard 555 to standard 755: 953 | find %{buildroot} -perm 555 -exec chmod 755 {} \; 954 | 955 | # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to 956 | # avoid the user having to know the precise version and ABI flags. 957 | # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 958 | %if %{with debug_build} 959 | ln -s \ 960 | %{_bindir}/python%{LDVERSION_debug} \ 961 | %{buildroot}%{_bindir}/python%{pybasever}-debug 962 | 963 | %if 0%{main_python3} 964 | ln -s \ 965 | %{_bindir}/python%{pybasever}-debug \ 966 | %{buildroot}%{_bindir}/python3-debug 967 | %endif 968 | %endif 969 | 970 | %if ! 0%{?main_python3} 971 | # make altinstall doesn't create python3.X-config, but we want it 972 | # (we don't want to have just python3.Xm-config, that's a bit confusing) 973 | ln -s \ 974 | %{_bindir}/python%{LDVERSION_optimized}-config \ 975 | %{buildroot}%{_bindir}/python%{pybasever}-config 976 | # make altinstall doesn't create python-3.6m.pc, only python-3.6.pc, but we want both 977 | ln -s \ 978 | %{_libdir}/pkgconfig/python-%{pybasever}.pc \ 979 | %{buildroot}%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc 980 | %endif 981 | 982 | # remove libpython3.so in EPEL non-main python to not cause collision 983 | # between python3X and python3X+1(or+2) stacks... 984 | %if ! 0%{?main_python3} 985 | rm -f %{buildroot}%{_libdir}/libpython3.so 986 | %endif 987 | 988 | # Provide the python36 binary symlink. 989 | ln -s \ 990 | %{_bindir}/python%{pybasever} \ 991 | %{buildroot}%{_bindir}/python%{pyshortver} 992 | 993 | 994 | # ====================================================== 995 | # Checks for packaging issues 996 | # ====================================================== 997 | 998 | %check 999 | 1000 | # first of all, check timestamps of bytecode files 1001 | find %{buildroot} -type f -a -name "*.py" -print0 | \ 1002 | LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ 1003 | PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ 1004 | xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8} 1005 | 1006 | # Ensure that the curses module was linked against libncursesw.so, rather than 1007 | # libncurses.so 1008 | # See https://bugzilla.redhat.com/show_bug.cgi?id=539917 1009 | ldd %{buildroot}/%{dynload_dir}/_curses*.so \ 1010 | | grep curses \ 1011 | | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1) 1012 | 1013 | # Ensure that the debug modules are linked against the debug libpython, and 1014 | # likewise for the optimized modules and libpython: 1015 | for Module in %{buildroot}/%{dynload_dir}/*.so ; do 1016 | case $Module in 1017 | *.%{SOABI_debug}) 1018 | ldd $Module | grep %{py_INSTSONAME_optimized} && 1019 | (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1) 1020 | 1021 | ;; 1022 | *.%{SOABI_optimized}) 1023 | ldd $Module | grep %{py_INSTSONAME_debug} && 1024 | (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1) 1025 | ;; 1026 | esac 1027 | done 1028 | 1029 | 1030 | # ====================================================== 1031 | # Running the upstream test suite 1032 | # ====================================================== 1033 | 1034 | # In some scenarios a larger stack is needed to avoid testInfiniteRecursion 1035 | # from segfaulting. This was previously seen on ppc64 (rhbz#1292462), and more 1036 | # recently on EL6. 1037 | %if 0%{?rhel} && 0%{?rhel} < 7 1038 | ulimit -a 1039 | ulimit -s 16384 1040 | %endif 1041 | 1042 | 1043 | topdir=$(pwd) 1044 | CheckPython() { 1045 | ConfName=$1 1046 | ConfDir=$(pwd)/build/$ConfName 1047 | 1048 | echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName 1049 | 1050 | # Note that we're running the tests using the version of the code in the 1051 | # builddir, not in the buildroot. 1052 | 1053 | # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the 1054 | # our non-standard decorators take effect on the relevant tests: 1055 | # @unittest._skipInRpmBuild(reason) 1056 | # @unittest._expectedFailureInRpmBuild 1057 | # test_faulthandler.test_register_chain currently fails on ppc64le and 1058 | # aarch64, see upstream bug http://bugs.python.org/issue21131 1059 | WITHIN_PYTHON_RPM_BUILD= \ 1060 | LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ 1061 | -wW --slowest --findleaks \ 1062 | -x test_distutils \ 1063 | -x test_bdist_rpm \ 1064 | %ifarch ppc64le aarch64 1065 | -x test_faulthandler \ 1066 | %endif 1067 | %ifarch %{mips64} 1068 | -x test_ctypes \ 1069 | %endif 1070 | %ifarch %{power64} s390 s390x armv7hl aarch64 %{mips} 1071 | -x test_gdb 1072 | %endif 1073 | 1074 | echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName 1075 | 1076 | } 1077 | 1078 | %if %{with tests} 1079 | 1080 | # Check each of the configurations: 1081 | %if %{with debug_build} 1082 | CheckPython debug 1083 | %endif # with debug_build 1084 | CheckPython optimized 1085 | 1086 | %endif # with tests 1087 | 1088 | 1089 | # ====================================================== 1090 | # Scriptlets 1091 | # ====================================================== 1092 | 1093 | %post libs -p /sbin/ldconfig 1094 | 1095 | %postun libs -p /sbin/ldconfig 1096 | 1097 | 1098 | %files 1099 | %license LICENSE 1100 | %doc README.rst 1101 | %{_bindir}/pydoc* 1102 | %if 0%{?main_python3} 1103 | %{_bindir}/python3 1104 | %endif 1105 | %{_bindir}/python%{pyshortver} 1106 | %{_bindir}/python%{pybasever} 1107 | %{_bindir}/python%{pybasever}m 1108 | %if 0%{?main_python3} 1109 | %{_bindir}/pyvenv 1110 | %endif 1111 | %{_bindir}/pyvenv-%{pybasever} 1112 | %{_mandir}/*/* 1113 | 1114 | %files libs 1115 | %license LICENSE 1116 | %doc README.rst 1117 | 1118 | %dir %{pylibdir} 1119 | %dir %{dynload_dir} 1120 | 1121 | %{pylibdir}/lib2to3 1122 | %exclude %{pylibdir}/lib2to3/tests 1123 | 1124 | %dir %{pylibdir}/unittest/ 1125 | %dir %{pylibdir}/unittest/__pycache__/ 1126 | %{pylibdir}/unittest/*.py 1127 | %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} 1128 | 1129 | %dir %{pylibdir}/asyncio/ 1130 | %dir %{pylibdir}/asyncio/__pycache__/ 1131 | %{pylibdir}/asyncio/*.py 1132 | %{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} 1133 | 1134 | %dir %{pylibdir}/venv/ 1135 | %dir %{pylibdir}/venv/__pycache__/ 1136 | %{pylibdir}/venv/*.py 1137 | %{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} 1138 | %{pylibdir}/venv/scripts 1139 | 1140 | %{pylibdir}/wsgiref 1141 | %{pylibdir}/xmlrpc 1142 | 1143 | %dir %{pylibdir}/ensurepip/ 1144 | %dir %{pylibdir}/ensurepip/__pycache__/ 1145 | %{pylibdir}/ensurepip/*.py 1146 | %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} 1147 | %{pylibdir}/ensurepip/_bundled 1148 | 1149 | %dir %{pylibdir}/test/ 1150 | %dir %{pylibdir}/test/__pycache__/ 1151 | %dir %{pylibdir}/test/support/ 1152 | %dir %{pylibdir}/test/support/__pycache__/ 1153 | %{pylibdir}/test/__init__.py 1154 | %{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} 1155 | %{pylibdir}/test/support/__init__.py 1156 | %{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes} 1157 | 1158 | %dir %{pylibdir}/concurrent/ 1159 | %dir %{pylibdir}/concurrent/__pycache__/ 1160 | %{pylibdir}/concurrent/*.py 1161 | %{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} 1162 | 1163 | %dir %{pylibdir}/concurrent/futures/ 1164 | %dir %{pylibdir}/concurrent/futures/__pycache__/ 1165 | %{pylibdir}/concurrent/futures/*.py 1166 | %{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} 1167 | 1168 | %{pylibdir}/pydoc_data 1169 | 1170 | %{dynload_dir}/_blake2.%{SOABI_optimized}.so 1171 | %{dynload_dir}/_md5.%{SOABI_optimized}.so 1172 | %{dynload_dir}/_sha1.%{SOABI_optimized}.so 1173 | %{dynload_dir}/_sha256.%{SOABI_optimized}.so 1174 | %{dynload_dir}/_sha3.%{SOABI_optimized}.so 1175 | %{dynload_dir}/_sha512.%{SOABI_optimized}.so 1176 | 1177 | %{dynload_dir}/_asyncio.%{SOABI_optimized}.so 1178 | %{dynload_dir}/_bisect.%{SOABI_optimized}.so 1179 | %{dynload_dir}/_bz2.%{SOABI_optimized}.so 1180 | %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so 1181 | %{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so 1182 | %{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so 1183 | %{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so 1184 | %{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so 1185 | %{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so 1186 | %{dynload_dir}/_crypt.%{SOABI_optimized}.so 1187 | %{dynload_dir}/_csv.%{SOABI_optimized}.so 1188 | %{dynload_dir}/_ctypes.%{SOABI_optimized}.so 1189 | %{dynload_dir}/_curses.%{SOABI_optimized}.so 1190 | %{dynload_dir}/_curses_panel.%{SOABI_optimized}.so 1191 | %{dynload_dir}/_dbm.%{SOABI_optimized}.so 1192 | %{dynload_dir}/_decimal.%{SOABI_optimized}.so 1193 | %{dynload_dir}/_elementtree.%{SOABI_optimized}.so 1194 | %if %{with gdbm} 1195 | %{dynload_dir}/_gdbm.%{SOABI_optimized}.so 1196 | %endif 1197 | %{dynload_dir}/_hashlib.%{SOABI_optimized}.so 1198 | %{dynload_dir}/_heapq.%{SOABI_optimized}.so 1199 | %{dynload_dir}/_json.%{SOABI_optimized}.so 1200 | %{dynload_dir}/_lsprof.%{SOABI_optimized}.so 1201 | %{dynload_dir}/_lzma.%{SOABI_optimized}.so 1202 | %{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so 1203 | %{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so 1204 | %{dynload_dir}/_opcode.%{SOABI_optimized}.so 1205 | %{dynload_dir}/_pickle.%{SOABI_optimized}.so 1206 | %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so 1207 | %{dynload_dir}/_random.%{SOABI_optimized}.so 1208 | %{dynload_dir}/_socket.%{SOABI_optimized}.so 1209 | %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so 1210 | %{dynload_dir}/_ssl.%{SOABI_optimized}.so 1211 | %{dynload_dir}/_struct.%{SOABI_optimized}.so 1212 | %{dynload_dir}/array.%{SOABI_optimized}.so 1213 | %{dynload_dir}/audioop.%{SOABI_optimized}.so 1214 | %{dynload_dir}/binascii.%{SOABI_optimized}.so 1215 | %{dynload_dir}/cmath.%{SOABI_optimized}.so 1216 | %{dynload_dir}/_datetime.%{SOABI_optimized}.so 1217 | %{dynload_dir}/fcntl.%{SOABI_optimized}.so 1218 | %{dynload_dir}/grp.%{SOABI_optimized}.so 1219 | %{dynload_dir}/math.%{SOABI_optimized}.so 1220 | %{dynload_dir}/mmap.%{SOABI_optimized}.so 1221 | %{dynload_dir}/nis.%{SOABI_optimized}.so 1222 | %{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so 1223 | %{dynload_dir}/parser.%{SOABI_optimized}.so 1224 | %{dynload_dir}/pyexpat.%{SOABI_optimized}.so 1225 | %{dynload_dir}/readline.%{SOABI_optimized}.so 1226 | %{dynload_dir}/resource.%{SOABI_optimized}.so 1227 | %{dynload_dir}/select.%{SOABI_optimized}.so 1228 | %{dynload_dir}/spwd.%{SOABI_optimized}.so 1229 | %{dynload_dir}/syslog.%{SOABI_optimized}.so 1230 | %{dynload_dir}/termios.%{SOABI_optimized}.so 1231 | %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so 1232 | %{dynload_dir}/unicodedata.%{SOABI_optimized}.so 1233 | %{dynload_dir}/xxlimited.%{SOABI_optimized}.so 1234 | %{dynload_dir}/zlib.%{SOABI_optimized}.so 1235 | 1236 | %dir %{pylibdir}/site-packages/ 1237 | %dir %{pylibdir}/site-packages/__pycache__/ 1238 | %{pylibdir}/site-packages/README.txt 1239 | %{pylibdir}/*.py 1240 | %dir %{pylibdir}/__pycache__/ 1241 | %{pylibdir}/__pycache__/*%{bytecode_suffixes} 1242 | 1243 | %dir %{pylibdir}/collections/ 1244 | %dir %{pylibdir}/collections/__pycache__/ 1245 | %{pylibdir}/collections/*.py 1246 | %{pylibdir}/collections/__pycache__/*%{bytecode_suffixes} 1247 | 1248 | %dir %{pylibdir}/ctypes/ 1249 | %dir %{pylibdir}/ctypes/__pycache__/ 1250 | %{pylibdir}/ctypes/*.py 1251 | %{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} 1252 | %{pylibdir}/ctypes/macholib 1253 | 1254 | %{pylibdir}/curses 1255 | 1256 | %dir %{pylibdir}/dbm/ 1257 | %dir %{pylibdir}/dbm/__pycache__/ 1258 | %{pylibdir}/dbm/*.py 1259 | %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} 1260 | 1261 | %dir %{pylibdir}/distutils/ 1262 | %dir %{pylibdir}/distutils/__pycache__/ 1263 | %{pylibdir}/distutils/*.py 1264 | %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} 1265 | %{pylibdir}/distutils/README 1266 | %{pylibdir}/distutils/command 1267 | 1268 | %dir %{pylibdir}/email/ 1269 | %dir %{pylibdir}/email/__pycache__/ 1270 | %{pylibdir}/email/*.py 1271 | %{pylibdir}/email/__pycache__/*%{bytecode_suffixes} 1272 | %{pylibdir}/email/mime 1273 | %doc %{pylibdir}/email/architecture.rst 1274 | 1275 | %{pylibdir}/encodings 1276 | 1277 | %{pylibdir}/html 1278 | %{pylibdir}/http 1279 | 1280 | %dir %{pylibdir}/importlib/ 1281 | %dir %{pylibdir}/importlib/__pycache__/ 1282 | %{pylibdir}/importlib/*.py 1283 | %{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} 1284 | 1285 | %dir %{pylibdir}/json/ 1286 | %dir %{pylibdir}/json/__pycache__/ 1287 | %{pylibdir}/json/*.py 1288 | %{pylibdir}/json/__pycache__/*%{bytecode_suffixes} 1289 | 1290 | %{pylibdir}/logging 1291 | %{pylibdir}/multiprocessing 1292 | 1293 | %dir %{pylibdir}/sqlite3/ 1294 | %dir %{pylibdir}/sqlite3/__pycache__/ 1295 | %{pylibdir}/sqlite3/*.py 1296 | %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} 1297 | 1298 | %exclude %{pylibdir}/turtle.py 1299 | %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} 1300 | 1301 | %{pylibdir}/urllib 1302 | %{pylibdir}/xml 1303 | 1304 | %if "%{_lib}" == "lib64" 1305 | %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} 1306 | %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages 1307 | %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/ 1308 | %endif 1309 | 1310 | # "Makefile" and the config-32/64.h file are needed by 1311 | # distutils/sysconfig.py:_init_posix(), so we include them in the core 1312 | # package, along with their parent directories (bug 531901): 1313 | %dir %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/ 1314 | %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile 1315 | %dir %{_includedir}/python%{LDVERSION_optimized}/ 1316 | %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} 1317 | 1318 | %{_libdir}/%{py_INSTSONAME_optimized} 1319 | %if 0%{?main_python3} 1320 | %{_libdir}/libpython3.so 1321 | %endif 1322 | 1323 | %files devel 1324 | %if 0%{?main_python3} 1325 | %{_bindir}/2to3-3 1326 | %endif 1327 | %{_bindir}/2to3-%{pybasever} 1328 | %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* 1329 | %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile 1330 | %{_includedir}/python%{LDVERSION_optimized}/*.h 1331 | %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} 1332 | %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit 1333 | %if 0%{?main_python3} 1334 | %{_bindir}/python3-config 1335 | %endif 1336 | %{_bindir}/python%{pybasever}-config 1337 | %{_bindir}/python%{LDVERSION_optimized}-config 1338 | %{_bindir}/python%{LDVERSION_optimized}-*-config 1339 | %{_bindir}/pathfix.py 1340 | %{_libdir}/libpython%{LDVERSION_optimized}.so 1341 | %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc 1342 | %{_libdir}/pkgconfig/python-%{pybasever}.pc 1343 | %if 0%{?main_python3} 1344 | %{_libdir}/pkgconfig/python3.pc 1345 | %endif 1346 | 1347 | %files idle 1348 | %{_bindir}/idle* 1349 | %{pylibdir}/idlelib 1350 | %if 0%{?main_python3} 1351 | %if %{undefined el6} 1352 | %{_datadir}/appdata/idle3.appdata.xml 1353 | %endif 1354 | %{_datadir}/applications/idle3.desktop 1355 | %{_datadir}/icons/hicolor/*/apps/idle3.* 1356 | %endif 1357 | 1358 | %files tkinter 1359 | %{pylibdir}/tkinter 1360 | %exclude %{pylibdir}/tkinter/test 1361 | %{dynload_dir}/_tkinter.%{SOABI_optimized}.so 1362 | %{pylibdir}/turtle.py 1363 | %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} 1364 | %dir %{pylibdir}/turtledemo 1365 | %{pylibdir}/turtledemo/*.py 1366 | %{pylibdir}/turtledemo/*.cfg 1367 | %dir %{pylibdir}/turtledemo/__pycache__/ 1368 | %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} 1369 | 1370 | %files test 1371 | %{pylibdir}/ctypes/test 1372 | %{pylibdir}/distutils/tests 1373 | %{pylibdir}/sqlite3/test 1374 | %{pylibdir}/test 1375 | %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so 1376 | %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so 1377 | %{dynload_dir}/_testcapi.%{SOABI_optimized}.so 1378 | %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so 1379 | %{pylibdir}/lib2to3/tests 1380 | %{pylibdir}/tkinter/test 1381 | %{pylibdir}/unittest/test 1382 | 1383 | 1384 | # We don't bother splitting the debug build out into further subpackages: 1385 | # if you need it, you're probably a developer. 1386 | 1387 | # Hence the manifest is the combination of analogous files in the manifests of 1388 | # all of the other subpackages 1389 | 1390 | %if %{with debug_build} 1391 | %files debug 1392 | 1393 | # Analog of the core subpackage's files: 1394 | %{_bindir}/python%{LDVERSION_debug} 1395 | %if 0%{?main_python3} 1396 | %{_bindir}/python3-debug 1397 | %endif 1398 | %{_bindir}/python%{pybasever}-debug 1399 | 1400 | # Analog of the -libs subpackage's files: 1401 | # ...with debug builds of the built-in "extension" modules: 1402 | 1403 | %{dynload_dir}/_blake2.%{SOABI_debug}.so 1404 | %{dynload_dir}/_md5.%{SOABI_debug}.so 1405 | %{dynload_dir}/_sha1.%{SOABI_debug}.so 1406 | %{dynload_dir}/_sha256.%{SOABI_debug}.so 1407 | %{dynload_dir}/_sha3.%{SOABI_debug}.so 1408 | %{dynload_dir}/_sha512.%{SOABI_debug}.so 1409 | 1410 | %{dynload_dir}/_asyncio.%{SOABI_debug}.so 1411 | %{dynload_dir}/_bisect.%{SOABI_debug}.so 1412 | %{dynload_dir}/_bz2.%{SOABI_debug}.so 1413 | %{dynload_dir}/_codecs_cn.%{SOABI_debug}.so 1414 | %{dynload_dir}/_codecs_hk.%{SOABI_debug}.so 1415 | %{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so 1416 | %{dynload_dir}/_codecs_jp.%{SOABI_debug}.so 1417 | %{dynload_dir}/_codecs_kr.%{SOABI_debug}.so 1418 | %{dynload_dir}/_codecs_tw.%{SOABI_debug}.so 1419 | %{dynload_dir}/_crypt.%{SOABI_debug}.so 1420 | %{dynload_dir}/_csv.%{SOABI_debug}.so 1421 | %{dynload_dir}/_ctypes.%{SOABI_debug}.so 1422 | %{dynload_dir}/_curses.%{SOABI_debug}.so 1423 | %{dynload_dir}/_curses_panel.%{SOABI_debug}.so 1424 | %{dynload_dir}/_dbm.%{SOABI_debug}.so 1425 | %{dynload_dir}/_decimal.%{SOABI_debug}.so 1426 | %{dynload_dir}/_elementtree.%{SOABI_debug}.so 1427 | %if %{with gdbm} 1428 | %{dynload_dir}/_gdbm.%{SOABI_debug}.so 1429 | %endif 1430 | %{dynload_dir}/_hashlib.%{SOABI_debug}.so 1431 | %{dynload_dir}/_heapq.%{SOABI_debug}.so 1432 | %{dynload_dir}/_json.%{SOABI_debug}.so 1433 | %{dynload_dir}/_lsprof.%{SOABI_debug}.so 1434 | %{dynload_dir}/_lzma.%{SOABI_debug}.so 1435 | %{dynload_dir}/_multibytecodec.%{SOABI_debug}.so 1436 | %{dynload_dir}/_multiprocessing.%{SOABI_debug}.so 1437 | %{dynload_dir}/_opcode.%{SOABI_debug}.so 1438 | %{dynload_dir}/_pickle.%{SOABI_debug}.so 1439 | %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so 1440 | %{dynload_dir}/_random.%{SOABI_debug}.so 1441 | %{dynload_dir}/_socket.%{SOABI_debug}.so 1442 | %{dynload_dir}/_sqlite3.%{SOABI_debug}.so 1443 | %{dynload_dir}/_ssl.%{SOABI_debug}.so 1444 | %{dynload_dir}/_struct.%{SOABI_debug}.so 1445 | %{dynload_dir}/array.%{SOABI_debug}.so 1446 | %{dynload_dir}/audioop.%{SOABI_debug}.so 1447 | %{dynload_dir}/binascii.%{SOABI_debug}.so 1448 | %{dynload_dir}/cmath.%{SOABI_debug}.so 1449 | %{dynload_dir}/_datetime.%{SOABI_debug}.so 1450 | %{dynload_dir}/fcntl.%{SOABI_debug}.so 1451 | %{dynload_dir}/grp.%{SOABI_debug}.so 1452 | %{dynload_dir}/math.%{SOABI_debug}.so 1453 | %{dynload_dir}/mmap.%{SOABI_debug}.so 1454 | %{dynload_dir}/nis.%{SOABI_debug}.so 1455 | %{dynload_dir}/ossaudiodev.%{SOABI_debug}.so 1456 | %{dynload_dir}/parser.%{SOABI_debug}.so 1457 | %{dynload_dir}/pyexpat.%{SOABI_debug}.so 1458 | %{dynload_dir}/readline.%{SOABI_debug}.so 1459 | %{dynload_dir}/resource.%{SOABI_debug}.so 1460 | %{dynload_dir}/select.%{SOABI_debug}.so 1461 | %{dynload_dir}/spwd.%{SOABI_debug}.so 1462 | %{dynload_dir}/syslog.%{SOABI_debug}.so 1463 | %{dynload_dir}/termios.%{SOABI_debug}.so 1464 | %{dynload_dir}/_testmultiphase.%{SOABI_debug}.so 1465 | %{dynload_dir}/unicodedata.%{SOABI_debug}.so 1466 | %{dynload_dir}/zlib.%{SOABI_debug}.so 1467 | 1468 | # No need to split things out the "Makefile" and the config-32/64.h file as we 1469 | # do for the regular build above (bug 531901), since they're all in one package 1470 | # now; they're listed below, under "-devel": 1471 | 1472 | %{_libdir}/%{py_INSTSONAME_debug} 1473 | 1474 | # Analog of the -devel subpackage's files: 1475 | %{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu} 1476 | %{_includedir}/python%{LDVERSION_debug} 1477 | %{_bindir}/python%{LDVERSION_debug}-config 1478 | %{_bindir}/python%{LDVERSION_debug}-*-config 1479 | %{_libdir}/libpython%{LDVERSION_debug}.so 1480 | %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc 1481 | 1482 | # Analog of the -tools subpackage's files: 1483 | # None for now; we could build precanned versions that have the appropriate 1484 | # shebang if needed 1485 | 1486 | # Analog of the tkinter subpackage's files: 1487 | %{dynload_dir}/_tkinter.%{SOABI_debug}.so 1488 | 1489 | # Analog of the -test subpackage's files: 1490 | %{dynload_dir}/_ctypes_test.%{SOABI_debug}.so 1491 | %{dynload_dir}/_testbuffer.%{SOABI_debug}.so 1492 | %{dynload_dir}/_testcapi.%{SOABI_debug}.so 1493 | %{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so 1494 | 1495 | %endif # with debug_build 1496 | 1497 | # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig 1498 | # See https://bugzilla.redhat.com/show_bug.cgi?id=562980 1499 | # 1500 | # The /usr/lib/rpm/redhat/macros defines %%__debug_package to use 1501 | # debugfiles.list, and it appears that everything below /usr/lib/debug and 1502 | # (/usr/src/debug) gets added to this file (via LISTFILES) in 1503 | # /usr/lib/rpm/find-debuginfo.sh 1504 | # 1505 | # Hence by installing it below /usr/lib/debug we ensure it is added to the 1506 | # -debuginfo subpackage 1507 | # (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py 1508 | # payload file would be unpackaged) 1509 | 1510 | # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593 1511 | %undefine _debuginfo_subpackages 1512 | 1513 | 1514 | # ====================================================== 1515 | # Finally, the changelog: 1516 | # ====================================================== 1517 | 1518 | %changelog 1519 | * Fri Aug 09 2019 Carl George - 3.6.8-2 1520 | - Rename to python36 1521 | - Always use system expat 1522 | - Sync build process with EPEL package 1523 | - Use macros from python-rpm-macros and python3-rpm-macros 1524 | - Sync tests with EPEL package 1525 | - Remove the python36-tools package and add python36-idle 1526 | - Use EPEL's main_python3 setup 1527 | - Add desktop entry and appdata.xml file for IDLE 3 1528 | - Add pathfix.py to python36-devel 1529 | - Filter out automatic /usr/bin/python3.X requirement 1530 | - Make pip and distutils in user environment install into separate location 1531 | - Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale 1532 | - Restore the PyExc_RecursionErrorInst public symbol 1533 | - Define TLS cipher suite on build time 1534 | - Make sure we don't ship any exe files (not needed an prebuilt) 1535 | - Security fix for CVE-2019-9636 and CVE-2019-10160 1536 | - Security fix for CVE-2019-9740 and CVE-2019-9947 1537 | - Security fix for CVE-2019-9948 1538 | 1539 | * Wed Mar 20 2019 evitalis - 3.6.8-1 1540 | - Latest upstream 1541 | - Add patch317 for CVE-2019-5010 (Fedora) 1542 | 1543 | * Wed Dec 05 2018 Carl George - 3.6.7-1.ius 1544 | - Latest upstream 1545 | 1546 | * Mon Apr 09 2018 Carl George - 3.6.5-1.ius 1547 | - Latest upstream 1548 | - Fix deprecation warning on using imp in check-pyc-and-pyo-timestamps.py (Fedora) 1549 | - Skip test_zlib on el6 1550 | 1551 | * Tue Dec 19 2017 Ben Harper - 3.6.4-1.ius 1552 | - Latest upstream 1553 | - Remove Patch277 and Patch279, fixed upstream 1554 | 1555 | * Wed Oct 11 2017 Carl George - 3.6.3-1.ius 1556 | - Latest upstream 1557 | - Skip test_bdist_rpm using test config rather than a patch (removes patch 137) (Fedora) 1558 | - Add patch277 to fix two hanging tests from test_subprocess (Fedora) 1559 | - Fix memory corruption due to allocator mix rhbz#1498207 (Fedora) 1560 | - Use a larger stack size on EL6 1561 | - Conditionalize systemtap-devel BuildRequires (Fedora) 1562 | - Drop patches 157 and 188 1563 | - Merge lib64 patches (104 into 102) (Fedora) 1564 | - Merge patches 180, 206, 243, 5001 (architecture naming) into new patch 274 (Fedora) 1565 | - Run autotools to generate the configure script before building (Fedora) 1566 | - Use bundled expat on EL6 1567 | - Move windows executables to the devel subpackage (rhbz#1426257) (Fedora) 1568 | - Drop patch252, as it was deemed unnecessary and could possibly collide with `pip --editable` option (Fedora) 1569 | - Use autoconf268 on EL6 1570 | 1571 | * Tue Jul 18 2017 Carl George - 3.6.2-1.ius 1572 | - Latest upstream 1573 | - Rebase patch180 1574 | - Remove patch249, resolved upstream pybt#28787 1575 | - Remove patch258, resolved upstream pybt#29324 1576 | 1577 | * Thu Apr 06 2017 Carl George - 3.6.1-2.ius 1578 | - EL6 support 1579 | - Remove minimum sqlite version (pybt#10740 and pybt#29098) 1580 | - Require correct version of expat{,-devel} 1581 | - Install the Makefile in its proper location (rhbz#1438219) (Fedora) 1582 | - Skip tan0064 in test_math and test_cmath on 32bit 1583 | 1584 | * Wed Mar 22 2017 Carl George - 3.6.1-1.ius 1585 | - Latest upstream 1586 | - Add --executable option to install.py command (Fedora) 1587 | - Fix syntax error in %%py_byte_compile macro (rhbz#1433569) (Fedora) 1588 | - Skip test_aead_aes_gcm during rpmbuild (Fedora) 1589 | 1590 | * Thu Jan 19 2017 Carl George - 3.6.0-2.ius 1591 | - Don't blow up on EL7 kernel (random generator) (rhbz#1410175) (Fedora) 1592 | - Define HAVE_LONG_LONG as 1 for backwards compatibility (Fedora) 1593 | - Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) (Fedora) 1594 | 1595 | * Wed Dec 28 2016 Carl George - 3.6.0-1.ius 1596 | - Port from Fedora to IUS 1597 | - Remove rewheel 1598 | - Undo https://fedoraproject.org/wiki/Changes/System_Python 1599 | - Import altinstall changes from EPEL's python34 1600 | - Cleanup libpython* files 1601 | - Add macros to optionally include the latest wheels of setuptools and pip 1602 | - Set minimum sqlite version 1603 | - Patch186 merged upstream 1604 | 1605 | * Tue Dec 27 2016 Charalampos Stratakis - 3.6.0-1 1606 | - Update to Python 3.6.0 final 1607 | 1608 | * Fri Dec 09 2016 Charalampos Stratakis - 3.6.0-0.6.rc1 1609 | - Enable rewheel 1610 | 1611 | * Wed Dec 07 2016 Charalampos Stratakis - 3.6.0-0.5.rc1 1612 | - Update to Python 3.6.0 release candidate 1 1613 | 1614 | * Mon Dec 05 2016 Charalampos Stratakis - 3.6.0-0.4.b4 1615 | - Update to Python 3.6.0 beta 4 1616 | 1617 | * Mon Dec 05 2016 Charalampos Stratakis - 3.5.2-7 1618 | - Set to work with pip version 9.0.1 1619 | 1620 | * Wed Oct 12 2016 Charalampos Stratakis - 3.5.2-6 1621 | - Use proper patch numbering and base upstream branch for 1622 | porting ssl and hashlib modules to OpenSSL 1.1.0 1623 | - Drop hashlib patch for now 1624 | - Add riscv64 arch to 64bit and no-valgrind arches 1625 | 1626 | * Tue Oct 11 2016 Tomáš Mráz - 3.5.2-5 1627 | - Make it build with OpenSSL-1.1.0 based on upstream patch 1628 | 1629 | * Wed Sep 14 2016 Charalampos Stratakis - 3.5.2-4 1630 | - Obsolete and Provide python35 package 1631 | 1632 | * Mon Sep 12 2016 Charalampos Stratakis - 3.5.2-3 1633 | - Update %%py_byte_compile macro 1634 | - Remove unused configure flags (rhbz#1374357) 1635 | 1636 | * Fri Sep 09 2016 Tomas Orsava - 3.5.2-2 1637 | - Updated .pyc 'bytecompilation with the newly installed interpreter' to also 1638 | recompile optimized .pyc files 1639 | - Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo 1640 | files are no more 1641 | - Resolves rhbz#1373635 1642 | 1643 | * Mon Aug 15 2016 Tomas Orsava - 3.5.2-1 1644 | - Rebased to version 3.5.2 1645 | - Set to work with pip version 8.1.2 1646 | - Removed patches 207, 237, 241 as fixes are already contained in Python 3.5.2 1647 | - Removed arch or environment specific patches 194, 196, 203, and 208 1648 | as test builds indicate they are no longer needed 1649 | - Updated patches 102, 146, and 242 to work with the new Python codebase 1650 | - Removed patches 200, 201, 5000 which weren't even being applied 1651 | 1652 | * Tue Aug 09 2016 Charalampos Stratakis - 3.5.1-15 1653 | - Fix for CVE-2016-1000110 HTTPoxy attack 1654 | - SPEC file cleanup 1655 | 1656 | * Mon Aug 01 2016 Michal Toman - 3.5.1-14 1657 | - Build properly on MIPS 1658 | 1659 | * Tue Jul 19 2016 Fedora Release Engineering - 3.5.1-13 1660 | - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages 1661 | 1662 | * Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-12 1663 | - Refactor patch for properly fixing CVE-2016-5636 1664 | 1665 | * Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-11 1666 | - Fix test_pyexpat failure with Expat version of 2.2.0 1667 | 1668 | * Fri Jul 08 2016 Miro Hrončok - 3.5.1-10 1669 | - Move xml module to system-python-libs 1670 | 1671 | * Thu Jun 16 2016 Tomas Orsava - 3.5.1-9 1672 | - Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack 1673 | - Raise an error when STARTTLS fails 1674 | - rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647 1675 | - rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 1676 | - Fixed upstream: https://hg.python.org/cpython/rev/d590114c2394 1677 | 1678 | * Mon Jun 13 2016 Charalampos Stratakis - 3.5.1-8 1679 | - Added patch for fixing possible integer overflow and heap corruption in zipimporter.get_data() 1680 | 1681 | * Fri Mar 04 2016 Miro Hrončok - 3.5.1-7 1682 | - Move distutils to system-python-libs 1683 | 1684 | * Wed Feb 24 2016 Robert Kuska - 3.5.1-6 1685 | - Provide python3-enum34 1686 | 1687 | * Fri Feb 19 2016 Miro Hrončok - 3.5.1-5 1688 | - Provide System Python packages and macros 1689 | 1690 | * Thu Feb 04 2016 Fedora Release Engineering - 3.5.1-4 1691 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 1692 | 1693 | * Wed Jan 13 2016 Orion Poplwski - 3.5.1-2 1694 | - Drop python3 macros, require python/python3-rpm-macros 1695 | 1696 | * Mon Dec 14 2015 Robert Kuska - 3.5.1-1 1697 | - Update to 3.5.1 1698 | - Removed patch 199 and 207 (upstream) 1699 | 1700 | * Sun Nov 15 2015 Robert Kuska - 3.5.0-5 1701 | - Remove versioned libpython from devel package 1702 | 1703 | * Fri Nov 13 2015 Than Ngo 3.5.0-4 1704 | - add correct arch for ppc64/ppc64le to fix build failure 1705 | 1706 | * Wed Nov 11 2015 Robert Kuska - 3.5.0-3 1707 | - Hide the private _Py_atomic_xxx symbols from public header 1708 | 1709 | * Wed Oct 14 2015 Robert Kuska - 3.5.0-2 1710 | - Rebuild with wheel set to 1 1711 | 1712 | * Tue Sep 15 2015 Matej Stuchlik - 3.5.0-1 1713 | - Update to 3.5.0 1714 | 1715 | * Mon Jun 29 2015 Thomas Spura - 3.4.3-4 1716 | - python3-devel: Require python-macros for version independant macros such as 1717 | python_provide. See fpc#281 and fpc#534. 1718 | 1719 | * Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 1720 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 1721 | 1722 | * Wed Jun 17 2015 Matej Stuchlik - 3.4.3-4 1723 | - Use 1024bit DH key in test_ssl 1724 | - Use -O0 when compiling -debug build 1725 | - Update pip version variable to the version we actually ship 1726 | 1727 | * Wed Jun 17 2015 Matej Stuchlik - 3.4.3-3 1728 | - Make relocating Python by changing _prefix actually work 1729 | Resolves: rhbz#1231801 1730 | 1731 | * Mon May 4 2015 Peter Robinson 3.4.3-2 1732 | - Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches 1733 | 1734 | * Thu Mar 12 2015 Matej Stuchlik - 3.4.3-1 1735 | - Updated to 3.4.3 1736 | - BuildPython now accepts additional build options 1737 | - Temporarily disabled test_gdb on arm (rhbz#1196181) 1738 | 1739 | * Wed Feb 25 2015 Matej Stuchlik - 3.4.2-7 1740 | - Fixed undefined behaviour in faulthandler which caused test to hang on x86_64 1741 | (http://bugs.python.org/issue23433) 1742 | 1743 | * Sat Feb 21 2015 Till Maas - 3.4.2-6 1744 | - Rebuilt for Fedora 23 Change 1745 | https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code 1746 | 1747 | * Tue Feb 17 2015 Ville Skyttä - 3.4.2-5 1748 | - Own systemtap dirs (#710733) 1749 | 1750 | * Mon Jan 12 2015 Dan Horák - 3.4.2-4 1751 | - build with valgrind on ppc64le 1752 | - disable test_gdb on s390(x) until rhbz#1181034 is resolved 1753 | 1754 | * Tue Dec 16 2014 Robert Kuska - 3.4.2-3 1755 | - New patches: 170 (gc asserts), 200 (gettext headers), 1756 | 201 (gdbm memory leak) 1757 | 1758 | * Thu Dec 11 2014 Robert Kuska - 3.4.2-2 1759 | - OpenSSL disabled SSLv3 in SSLv23 method 1760 | 1761 | * Thu Nov 13 2014 Matej Stuchlik - 3.4.2-1 1762 | - Update to 3.4.2 1763 | - Refreshed patches: 156 (gdb autoload) 1764 | - Removed: 195 (Werror declaration), 197 (CVE-2014-4650) 1765 | 1766 | * Mon Nov 03 2014 Slavek Kabrda - 3.4.1-16 1767 | - Fix CVE-2014-4650 - CGIHTTPServer URL handling 1768 | Resolves: rhbz#1113529 1769 | 1770 | * Sun Sep 07 2014 Karsten Hopp 3.4.1-15 1771 | - exclude test_gdb on ppc* (rhbz#1132488) 1772 | 1773 | * Thu Aug 21 2014 Slavek Kabrda - 3.4.1-14 1774 | - Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1 1775 | 1776 | * Sun Aug 17 2014 Fedora Release Engineering - 3.4.1-13 1777 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 1778 | 1779 | * Sun Jun 8 2014 Peter Robinson 3.4.1-12 1780 | - aarch64 has valgrind, just list those that don't support it 1781 | 1782 | * Sun Jun 08 2014 Fedora Release Engineering - 3.4.1-11 1783 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 1784 | 1785 | * Wed Jun 04 2014 Karsten Hopp 3.4.1-10 1786 | - bump release and rebuild to link with the correct tcl/tk libs on ppcle 1787 | 1788 | * Tue Jun 03 2014 Matej Stuchlik - 3.4.1-9 1789 | - Change paths to bundled projects in rewheel patch 1790 | 1791 | * Fri May 30 2014 Miro Hrončok - 3.4.1-8 1792 | - In config script, use uname -m to write the arch 1793 | 1794 | * Thu May 29 2014 Dan Horák - 3.4.1-7 1795 | - update the arch list where valgrind exists - %%power64 includes also 1796 | ppc64le which is not supported yet 1797 | 1798 | * Thu May 29 2014 Miro Hrončok - 3.4.1-6 1799 | - Forward arguments to the arch specific config script 1800 | Resolves: rhbz#1102683 1801 | 1802 | * Wed May 28 2014 Miro Hrončok - 3.4.1-5 1803 | - Rename python3.Xm-config script to arch specific. 1804 | Resolves: rhbz#1091815 1805 | 1806 | * Tue May 27 2014 Bohuslav Kabrda - 3.4.1-4 1807 | - Use python3-*, not python-* runtime requires on setuptools and pip 1808 | - rebuild for tcl-8.6 1809 | 1810 | * Tue May 27 2014 Matej Stuchlik - 3.4.1-3 1811 | - Update the rewheel module 1812 | 1813 | * Mon May 26 2014 Miro Hrončok - 3.4.1-2 1814 | - Fix multilib dependencies. 1815 | Resolves: rhbz#1091815 1816 | 1817 | * Sun May 25 2014 Matej Stuchlik - 3.4.1-1 1818 | - Update to Python 3.4.1 1819 | 1820 | * Sun May 25 2014 Matej Stuchlik - 3.4.0-8 1821 | - Fix test_gdb failure on ppc64le 1822 | Resolves: rhbz#1095355 1823 | 1824 | * Thu May 22 2014 Miro Hrončok - 3.4.0-7 1825 | - Add macro %%python3_version_nodots 1826 | 1827 | * Sun May 18 2014 Matej Stuchlik - 3.4.0-6 1828 | - Disable test_faulthandler, test_gdb on aarch64 1829 | Resolves: rhbz#1045193 1830 | 1831 | * Fri May 16 2014 Matej Stuchlik - 3.4.0-5 1832 | - Don't add Werror=declaration-after-statement for extension 1833 | modules through setup.py (PyBT#21121) 1834 | 1835 | * Mon May 12 2014 Matej Stuchlik - 3.4.0-4 1836 | - Add setuptools and pip to Requires 1837 | 1838 | * Tue Apr 29 2014 Matej Stuchlik - 3.4.0-3 1839 | - Point __os_install_post to correct brp-* files 1840 | 1841 | * Tue Apr 15 2014 Matej Stuchlik - 3.4.0-2 1842 | - Temporarily disable tests requiring SIGHUP (rhbz#1088233) 1843 | 1844 | * Tue Apr 15 2014 Matej Stuchlik - 3.4.0-1 1845 | - Update to Python 3.4 final 1846 | - Add patch adding the rewheel module 1847 | - Merge patches from master 1848 | 1849 | * Wed Jan 08 2014 Bohuslav Kabrda - 3.4.0-0.1.b2 1850 | - Update to Python 3.4 beta 2. 1851 | - Refreshed patches: 55 (systemtap), 146 (hashlib-fips), 154 (test_gdb noise) 1852 | - Dropped patches: 114 (statvfs constants), 177 (platform unicode) 1853 | 1854 | * Mon Nov 25 2013 Bohuslav Kabrda - 3.4.0-0.1.b1 1855 | - Update to Python 3.4 beta 1. 1856 | - Refreshed patches: 102 (lib64), 111 (no static lib), 125 (less verbose COUNT 1857 | ALLOCS), 141 (fix COUNT_ALLOCS in test_module), 146 (hashlib fips), 1858 | 157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port) 1859 | - Removed patch 00187 (remove pthread atfork; upstreamed) 1860 | 1861 | * Mon Nov 04 2013 Bohuslav Kabrda - 3.4.0-0.1.a4 1862 | - Update to Python 3.4 alpha 4. 1863 | - Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib), 1864 | 114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in 1865 | test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise), 1866 | 157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise 1867 | from py_compile) 1868 | - Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in 1869 | Koji), 142 (the mock issue that caused this is fixed) 1870 | - Added patch 187 (remove thread atfork) - will be in next version 1871 | - Refreshed script for checking pyc and pyo timestamps with new ignored files. 1872 | - The fips patch is disabled for now until upstream makes a final decision 1873 | what to do with sha3 implementation for 3.4.0. 1874 | 1875 | * Wed Oct 30 2013 Bohuslav Kabrda - 3.3.2-7 1876 | - Bytecompile all *.py files properly during build (rhbz#1023607) 1877 | 1878 | * Fri Aug 23 2013 Matej Stuchlik - 3.3.2-6 1879 | - Added fix for CVE-2013-4238 (rhbz#996399) 1880 | 1881 | * Fri Jul 26 2013 Dennis Gilmore - 3.3.2-5 1882 | - fix up indentation in arm patch 1883 | 1884 | * Fri Jul 26 2013 Dennis Gilmore - 3.3.2-4 1885 | - disable a test that fails on arm 1886 | - enable valgrind support on arm arches 1887 | 1888 | * Tue Jul 02 2013 Bohuslav Kabrda - 3.3.2-3 1889 | - Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696). 1890 | 1891 | * Mon May 20 2013 Bohuslav Kabrda - 3.3.2-2 1892 | - Add patch for CVE-2013-2099 (rhbz#963261). 1893 | 1894 | * Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 1895 | - Updated to Python 3.3.2. 1896 | - Refreshed patches: 153 (gdb test noise) 1897 | - Dropped patches: 175 (configure -Wformat, fixed upstream), 182 (gdb 1898 | test threads) 1899 | - Synced patch numbers with python.spec. 1900 | 1901 | * Thu May 9 2013 David Malcolm - 3.3.1-4 1902 | - fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) 1903 | 1904 | * Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 1905 | - Add patch that enables building on ppc64p7 (replace the sed, so that 1906 | we get consistent with python2 spec and it's more obvious that we're doing it. 1907 | 1908 | * Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 1909 | - Add fix for gdb tests failing on arm, rhbz#951802. 1910 | 1911 | * Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 1912 | - Updated to Python 3.3.1. 1913 | - Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), 1914 | 153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just 1915 | keeping few more downstream tests) 1916 | - Removed patches: 3 (audiotest.au made it to upstream tarball) 1917 | - Removed workaround for http://bugs.python.org/issue14774, discussed in 1918 | http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. 1919 | 1920 | * Mon Mar 25 2013 David Malcolm - 3.3.0-10 1921 | - fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates 1922 | 1923 | * Mon Mar 25 2013 David Malcolm - 3.3.0-9 1924 | - renumber patches to keep them in sync with python.spec 1925 | 1926 | * Fri Mar 15 2013 Toshio Kuratomi - 3.3.0-8 1927 | - Fix error in platform.platform() when non-ascii byte strings are decoded to 1928 | unicode (rhbz#922149) 1929 | 1930 | * Thu Mar 14 2013 Toshio Kuratomi - 3.3.0-7 1931 | - Fix up shared library extension (rhbz#889784) 1932 | 1933 | * Thu Mar 07 2013 Karsten Hopp 3.3.0-6 1934 | - add ppc64p7 build target, optimized for Power7 1935 | 1936 | * Mon Mar 4 2013 David Malcolm - 3.3.0-5 1937 | - add workaround for ENOPROTOOPT seen running selftests in Koji 1938 | (rhbz#913732) 1939 | 1940 | * Mon Mar 4 2013 David Malcolm - 3.3.0-4 1941 | - remove config flag from /etc/rpm/macros.{python3|pybytecompile} 1942 | 1943 | * Mon Feb 11 2013 David Malcolm - 3.3.0-3 1944 | - add aarch64 (rhbz#909783) 1945 | 1946 | * Thu Nov 29 2012 David Malcolm - 3.3.0-2 1947 | - add BR on bluez-libs-devel (rhbz#879720) 1948 | 1949 | * Sat Sep 29 2012 David Malcolm - 3.3.0-1 1950 | - 3.3.0rc3 -> 3.3.0; drop alphatag 1951 | 1952 | * Mon Sep 24 2012 David Malcolm - 3.3.0-0.6.rc3 1953 | - 3.3.0rc2 -> 3.3.0rc3 1954 | 1955 | * Mon Sep 10 2012 David Malcolm - 3.3.0-0.5.rc2 1956 | - 3.3.0rc1 -> 3.3.0rc2; refresh patch 55 1957 | 1958 | * Mon Aug 27 2012 David Malcolm - 3.3.0-0.4.rc1 1959 | - 3.3.0b2 -> 3.3.0rc1; refresh patches 3, 55 1960 | 1961 | * Mon Aug 13 2012 David Malcolm - 3.3.0-0.3.b2 1962 | - 3.3b1 -> 3.3b2; drop upstreamed patch 152; refresh patches 3, 102, 111, 1963 | 134, 153, 160; regenenerate autotools patch; rework systemtap patch to work 1964 | correctly when LANG=C (patch 55); importlib.test was moved to 1965 | test.test_importlib upstream 1966 | 1967 | * Mon Aug 13 2012 Karsten Hopp 3.3.0-0.2.b1 1968 | - disable some failing checks on PPC* (rhbz#846849) 1969 | 1970 | * Fri Aug 3 2012 David Malcolm - 3.3.0-0.1.b1 1971 | - 3.2 -> 3.3: https://fedoraproject.org/wiki/Features/Python_3.3 1972 | - 3.3.0b1: refresh patches 3, 55, 102, 111, 113, 114, 134, 157; drop upstream 1973 | patch 147; regenenerate autotools patch; drop "--with-wide-unicode" from 1974 | configure (PEP 393); "plat-linux2" -> "plat-linux" (upstream issue 12326); 1975 | "bz2" -> "_bz2" and "crypt" -> "_crypt"; egg-info files are no longer shipped 1976 | for stdlib (upstream issues 10645 and 12218); email/test moved to 1977 | test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add 1978 | _decimal and _lzma modules; make collections modules explicit in payload again 1979 | (upstream issue 11085); add _testbuffer module to tests subpackage (added in 1980 | upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); 1981 | workaround erroneously shared _sysconfigdata.py upstream issue #14774; fix 1982 | distutils.sysconfig traceback (patch 162); add BuildRequires: xz-devel (for 1983 | _lzma module); skip some tests within test_socket (patch 163) 1984 | 1985 | * Sat Jul 21 2012 Fedora Release Engineering - 3.2.3-11 1986 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 1987 | 1988 | * Fri Jul 20 2012 David Malcolm - 3.3.0-0.1.b1 1989 | 1990 | * Fri Jun 22 2012 David Malcolm - 3.2.3-10 1991 | - use macro for power64 (rhbz#834653) 1992 | 1993 | * Mon Jun 18 2012 David Malcolm - 3.2.3-9 1994 | - fix missing include in uid/gid handling patch (patch 157; rhbz#830405) 1995 | 1996 | * Wed May 30 2012 Bohuslav Kabrda - 3.2.3-8 1997 | - fix tapset for debug build 1998 | 1999 | * Tue May 15 2012 David Malcolm - 3.2.3-7 2000 | - update uid/gid handling to avoid int overflows seen with uid/gid 2001 | values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470) 2002 | 2003 | * Fri May 4 2012 David Malcolm - 3.2.3-6 2004 | - renumber autotools patch from 300 to 5000 2005 | - specfile cleanups 2006 | 2007 | * Mon Apr 30 2012 David Malcolm - 3.2.3-5 2008 | - fix test_gdb.py (patch 156; rhbz#817072) 2009 | 2010 | * Fri Apr 20 2012 David Malcolm - 3.2.3-4 2011 | - avoid allocating thunks in ctypes unless absolutely necessary, to avoid 2012 | generating SELinux denials on "import ctypes" and "import uuid" when embedding 2013 | Python within httpd (patch 155; rhbz#814391) 2014 | 2015 | * Fri Apr 20 2012 David Malcolm - 3.2.3-3 2016 | - add explicit version requirements on expat to avoid linkage problems with 2017 | XML_SetHashSalt 2018 | 2019 | * Thu Apr 12 2012 David Malcolm - 3.2.3-2 2020 | - fix test_gdb (patch 153) 2021 | 2022 | * Wed Apr 11 2012 David Malcolm - 3.2.3-1 2023 | - 3.2.3; refresh patch 102 (lib64); drop upstream patches 148 (gdbm magic 2024 | values), 149 (__pycache__ fix); add patch 152 (test_gdb regex) 2025 | 2026 | * Thu Feb 9 2012 Thomas Spura - 3.2.2-13 2027 | - use newly installed python for byte compiling (now for real) 2028 | 2029 | * Sun Feb 5 2012 Thomas Spura - 3.2.2-12 2030 | - use newly installed python for byte compiling (#787498) 2031 | 2032 | * Wed Jan 4 2012 Ville Skyttä - 3.2.2-11 2033 | - Build with $RPM_LD_FLAGS (#756863). 2034 | - Use xz-compressed source tarball. 2035 | 2036 | * Wed Dec 07 2011 Karsten Hopp 3.2.2-10 2037 | - disable rAssertAlmostEqual in test_cmath on PPC (#750811) 2038 | 2039 | * Mon Oct 17 2011 Rex Dieter - 3.2.2-9 2040 | - python3-devel missing autogenerated pkgconfig() provides (#746751) 2041 | 2042 | * Mon Oct 10 2011 David Malcolm - 3.2.2-8 2043 | - cherrypick fix for distutils not using __pycache__ when byte-compiling 2044 | files (rhbz#722578) 2045 | 2046 | * Fri Sep 30 2011 David Malcolm - 3.2.2-7 2047 | - re-enable gdbm (patch 148; rhbz#742242) 2048 | 2049 | * Fri Sep 16 2011 David Malcolm - 3.2.2-6 2050 | - add a sys._debugmallocstats() function (patch 147) 2051 | 2052 | * Wed Sep 14 2011 David Malcolm - 3.2.2-5 2053 | - support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and 2054 | _sha* modules, relying on _hashlib in hashlib (rhbz#563986; patch 146) 2055 | 2056 | * Tue Sep 13 2011 David Malcolm - 3.2.2-4 2057 | - disable gdbm module to prepare for gdbm soname bump 2058 | 2059 | * Mon Sep 12 2011 David Malcolm - 3.2.2-3 2060 | - renumber and rename patches for consistency with python.spec (8 to 55, 106 2061 | to 104, 6 to 111, 104 to 113, 105 to 114, 125, 131, 130 to 143) 2062 | 2063 | * Sat Sep 10 2011 David Malcolm - 3.2.2-2 2064 | - rewrite of "check", introducing downstream-only hooks for skipping specific 2065 | cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more 2066 | fine-grained manner than before; (patches 106, 133-142 sparsely, moving 2067 | patches for consistency with python.spec: 128 to 134, 126 to 135, 127 to 141) 2068 | 2069 | * Tue Sep 6 2011 David Malcolm - 3.2.2-1 2070 | - 3.2.2 2071 | 2072 | * Thu Sep 1 2011 David Malcolm - 3.2.1-7 2073 | - run selftests with "--verbose" 2074 | - disable parts of test_io on ppc (rhbz#732998) 2075 | 2076 | * Wed Aug 31 2011 David Malcolm - 3.2.1-6 2077 | - use "--findleaks --verbose3" when running test suite 2078 | 2079 | * Tue Aug 23 2011 David Malcolm - 3.2.1-5 2080 | - re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit 2081 | ppc to avoid aliasing violations (patch 130; rhbz#698726) 2082 | 2083 | * Tue Aug 23 2011 David Malcolm - 3.2.1-4 2084 | - don't use --with-tsc on ppc64 debug builds (rhbz#698726) 2085 | 2086 | * Thu Aug 18 2011 David Malcolm - 3.2.1-3 2087 | - add %%python3_version to the rpm macros (rhbz#719082) 2088 | 2089 | * Mon Jul 11 2011 Dennis Gilmore - 3.2.1-2 2090 | - disable some tests on sparc arches 2091 | 2092 | * Mon Jul 11 2011 David Malcolm - 3.2.1-1 2093 | - 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling 2094 | of static library build (due to Modules/_testembed; patch 6), autotool 2095 | intermediates (patch 300) 2096 | 2097 | * Fri Jul 8 2011 David Malcolm - 3.2-5 2098 | - use the gdb hooks from the upstream tarball, rather than keeping our own copy 2099 | 2100 | * Fri Jul 8 2011 David Malcolm - 3.2-4 2101 | - don't run test_openpty and test_pty in %%check 2102 | 2103 | * Fri Jul 8 2011 David Malcolm - 3.2-3 2104 | - cleanup of BuildRequires; add comment headings to specfile sections 2105 | 2106 | * Tue Apr 19 2011 David Malcolm - 3.2-2 2107 | - fix the libpython.stp systemtap tapset (rhbz#697730) 2108 | 2109 | * Mon Feb 21 2011 David Malcolm - 3.2-1 2110 | - 3.2 2111 | - drop alphatag 2112 | - regenerate autotool patch 2113 | 2114 | * Mon Feb 14 2011 David Malcolm - 3.2-0.13.rc3 2115 | - add a /usr/bin/python3-debug symlink within the debug subpackage 2116 | 2117 | * Mon Feb 14 2011 David Malcolm - 3.2-0.12.rc3 2118 | - 3.2rc3 2119 | - regenerate autotool patch 2120 | 2121 | * Wed Feb 09 2011 Fedora Release Engineering - 3.2-0.11.rc2 2122 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2123 | 2124 | * Mon Jan 31 2011 David Malcolm - 3.2-0.10.rc2 2125 | - 3.2rc2 2126 | 2127 | * Mon Jan 17 2011 David Malcolm - 3.2-0.9.rc1 2128 | - 3.2rc1 2129 | - rework patch 6 (static lib removal) 2130 | - remove upstreamed patch 130 (ppc debug build) 2131 | - regenerate patch 300 (autotool intermediates) 2132 | - updated packaging to reflect upstream rewrite of "Demo" (issue 7962) 2133 | - added libpython3.so and 2to3-3.2 2134 | 2135 | * Wed Jan 5 2011 David Malcolm - 3.2-0.8.b2 2136 | - set EXTRA_CFLAGS to our CFLAGS, rather than overriding OPT, fixing a linker 2137 | error with dynamic annotations (when configured using --with-valgrind) 2138 | - fix the ppc build of the debug configuration (patch 130; rhbz#661510) 2139 | 2140 | * Tue Jan 4 2011 David Malcolm - 3.2-0.7.b2 2141 | - add --with-valgrind to configuration (on architectures that support this) 2142 | 2143 | * Wed Dec 29 2010 David Malcolm - 3.2-0.6.b2 2144 | - work around test_subprocess failure seen in koji (patch 129) 2145 | 2146 | * Tue Dec 28 2010 David Malcolm - 3.2-0.5.b2 2147 | - 3.2b2 2148 | - rework patch 3 (removal of mimeaudio tests), patch 6 (no static libs), 2149 | patch 8 (systemtap), patch 102 (lib64) 2150 | - remove patch 4 (rendered redundant by upstream r85537), patch 103 (PEP 3149), 2151 | patch 110 (upstreamed expat fix), patch 111 (parallel build fix for grammar 2152 | fixed upstream) 2153 | - regenerate patch 300 (autotool intermediates) 2154 | - workaround COUNT_ALLOCS weakref issues in test suite (patch 126, patch 127, 2155 | patch 128) 2156 | - stop using runtest.sh in %%check (dropped by upstream), replacing with 2157 | regrtest; fixup list of failing tests 2158 | - introduce "pyshortver", "SOABI_optimized" and "SOABI_debug" macros 2159 | - rework manifests of shared libraries to use "SOABI_" macros, reflecting 2160 | PEP 3149 2161 | - drop itertools, operator and _collections modules from the manifests as py3k 2162 | commit r84058 moved these inside libpython; json/tests moved to test/json_tests 2163 | - move turtle code into the tkinter subpackage 2164 | 2165 | * Wed Nov 17 2010 David Malcolm - 3.2-0.5.a1 2166 | - fix sysconfig to not rely on the -devel subpackage (rhbz#653058) 2167 | 2168 | * Thu Sep 9 2010 David Malcolm - 3.2-0.4.a1 2169 | - move most of the content of the core package to the libs subpackage, given 2170 | that the libs aren't meaningfully usable without the standard libraries 2171 | 2172 | * Wed Sep 8 2010 David Malcolm - 3.2-0.3.a1 2173 | - Move test.support to core package (rhbz#596258) 2174 | - Add various missing __pycache__ directories to payload 2175 | 2176 | * Sun Aug 22 2010 Toshio Kuratomi - 3.2-0.2.a1 2177 | - Add __pycache__ directory for site-packages 2178 | 2179 | * Sun Aug 22 2010 Thomas Spura - 3.2-0.1.a1 2180 | - on 64bit "stdlib" was still "/usr/lib/python*" (modify *lib64.patch) 2181 | - make find-provides-without-python-sonames.sh 64bit aware 2182 | 2183 | * Sat Aug 21 2010 David Malcolm - 3.2-0.0.a1 2184 | - 3.2a1; add alphatag 2185 | - rework %%files in the light of PEP 3147 (__pycache__) 2186 | - drop our configuration patch to Setup.dist (patch 0): setup.py should do a 2187 | better job of things, and the %%files explicitly lists our modules (r82746 2188 | appears to break the old way of doing things). This leads to various modules 2189 | changing from "foomodule.so" to "foo.so". It also leads to the optimized build 2190 | dropping the _sha1, _sha256 and _sha512 modules, but these are provided by 2191 | _hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for 2192 | testing/devel purposes) 2193 | - fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase 2194 | - remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat 2195 | plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983) 2196 | - add machinery for rebuilding "configure" and friends, using the correct 2197 | version of autoconf (patch 300) 2198 | - patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125) 2199 | - "modulator" was removed upstream 2200 | - drop "-b" from patch applications affecting .py files to avoid littering the 2201 | installation tree 2202 | 2203 | * Thu Aug 19 2010 Toshio Kuratomi - 3.1.2-13 2204 | - Turn on computed-gotos. 2205 | - Fix for parallel make and graminit.c 2206 | 2207 | * Fri Jul 2 2010 David Malcolm - 3.1.2-12 2208 | - rebuild 2209 | 2210 | * Fri Jul 2 2010 David Malcolm - 3.1.2-11 2211 | - Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to 2212 | a segfault running test_pyexpat.py (patch 110; upstream issue 9054; rhbz#610312) 2213 | 2214 | * Fri Jun 4 2010 David Malcolm - 3.1.2-10 2215 | - ensure that the compiler is invoked with "-fwrapv" (rhbz#594819) 2216 | - reformat whitespace in audioop.c (patch 106) 2217 | - CVE-2010-1634: fix various integer overflow checks in the audioop 2218 | module (patch 107) 2219 | - CVE-2010-2089: further checks within the audioop module (patch 108) 2220 | - CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 109) 2221 | 2222 | * Thu May 27 2010 Dan Horák - 3.1.2-9 2223 | - reading the timestamp counter is available only on some arches (see Python/ceval.c) 2224 | 2225 | * Wed May 26 2010 David Malcolm - 3.1.2-8 2226 | - add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os") 2227 | (patch 105) 2228 | 2229 | * Tue May 25 2010 David Malcolm - 3.1.2-7 2230 | - add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options 2231 | (patch 104); enable them and the WITH_TSC option within the debug build 2232 | 2233 | * Mon May 24 2010 David Malcolm - 3.1.2-6 2234 | - build and install two different configurations of Python 3: debug and 2235 | standard, packaging the debug build in a new "python3-debug" subpackage 2236 | (patch 103) 2237 | 2238 | * Tue Apr 13 2010 David Malcolm - 3.1.2-5 2239 | - exclude test_http_cookies when running selftests, due to hang seen on 2240 | http://koji.fedoraproject.org/koji/taskinfo?taskID=2088463 (cancelled after 2241 | 11 hours) 2242 | - update python-gdb.py from v5 to py3k version submitted upstream 2243 | 2244 | * Wed Mar 31 2010 David Malcolm - 3.1.2-4 2245 | - update python-gdb.py from v4 to v5 (improving performance and stability, 2246 | adding commands) 2247 | 2248 | * Thu Mar 25 2010 David Malcolm - 3.1.2-3 2249 | - update python-gdb.py from v3 to v4 (fixing infinite recursion on reference 2250 | cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets 2251 | and exceptions) 2252 | 2253 | * Wed Mar 24 2010 David Malcolm - 3.1.2-2 2254 | - refresh gdb hooks to v3 (reworking how they are packaged) 2255 | 2256 | * Sun Mar 21 2010 David Malcolm - 3.1.2-1 2257 | - update to 3.1.2: http://www.python.org/download/releases/3.1.2/ 2258 | - drop upstreamed patch 2 (.pyc permissions handling) 2259 | - drop upstream patch 5 (fix for the test_tk and test_ttk_* selftests) 2260 | - drop upstreamed patch 200 (path-fixing script) 2261 | 2262 | * Sat Mar 20 2010 David Malcolm - 3.1.1-28 2263 | - fix typo in libpython.stp (rhbz:575336) 2264 | 2265 | * Fri Mar 12 2010 David Malcolm - 3.1.1-27 2266 | - add pyfuntop.stp example (source 7) 2267 | - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for 2268 | consistency with python.spec 2269 | 2270 | * Mon Feb 15 2010 Thomas Spura - 3.1.1-26 2271 | - rebuild for new package of redhat-rpm-config (rhbz:564527) 2272 | - use 'install -p' when running 'make install' 2273 | 2274 | * Fri Feb 12 2010 David Malcolm - 3.1.1-25 2275 | - split configure options into multiple lines for easy of editing 2276 | - add systemtap static markers (wcohen, mjw, dmalcolm; patch 8), a systemtap 2277 | tapset defining "python.function.entry" and "python.function.return" to make 2278 | the markers easy to use (dmalcolm; source 5), and an example of using the 2279 | tapset to the docs (dmalcolm; source 6) (rhbz:545179) 2280 | 2281 | * Mon Feb 8 2010 David Malcolm - 3.1.1-24 2282 | - move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to 2283 | %%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from 2284 | ldconfig (bug 562980), and which should also ensure it becomes part of the 2285 | debuginfo subpackage, rather than the libs subpackage 2286 | - introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream 2287 | configure script, and to avoid fragile scripts that try to figure this out 2288 | dynamically (e.g. for the -gdb.py change) 2289 | 2290 | * Mon Feb 8 2010 David Malcolm - 3.1.1-23 2291 | - add gdb hooks for easier debugging (Source 4) 2292 | 2293 | * Thu Jan 28 2010 David Malcolm - 3.1.1-22 2294 | - update python-3.1.1-config.patch to remove downstream customization of build 2295 | of pyexpat and elementtree modules 2296 | - add patch adapted from upstream (patch 7) to add support for building against 2297 | system expat; add --with-system-expat to "configure" invocation 2298 | - remove embedded copies of expat and zlib from source tree during "prep" 2299 | 2300 | * Mon Jan 25 2010 David Malcolm - 3.1.1-21 2301 | - introduce %%{dynload_dir} macro 2302 | - explicitly list all lib-dynload files, rather than dynamically gathering the 2303 | payload into a temporary text file, so that we can be sure what we are 2304 | shipping 2305 | - introduce a macros.pybytecompile source file, to help with packaging python3 2306 | modules (Source3; written by Toshio) 2307 | - rename "2to3-3" to "python3-2to3" to better reflect python 3 module packaging 2308 | plans 2309 | 2310 | * Mon Jan 25 2010 David Malcolm - 3.1.1-20 2311 | - change python-3.1.1-config.patch to remove our downstream change to curses 2312 | configuration in Modules/Setup.dist, so that the curses modules are built using 2313 | setup.py with the downstream default (linking against libncursesw.so, rather 2314 | than libncurses.so), rather than within the Makefile; add a test to %%install 2315 | to verify the dso files that the curses module is linked against the correct 2316 | DSO (bug 539917; changes _cursesmodule.so -> _curses.so) 2317 | 2318 | * Fri Jan 22 2010 David Malcolm - 3.1.1-19 2319 | - add %%py3dir macro to macros.python3 (to be used during unified python 2/3 2320 | builds for setting up the python3 copy of the source tree) 2321 | 2322 | * Wed Jan 20 2010 David Malcolm - 3.1.1-18 2323 | - move lib2to3 from -tools subpackage to main package (bug 556667) 2324 | 2325 | * Sun Jan 17 2010 David Malcolm - 3.1.1-17 2326 | - patch Makefile.pre.in to avoid building static library (patch 6, bug 556092) 2327 | 2328 | * Fri Jan 15 2010 David Malcolm - 3.1.1-16 2329 | - use the %%{_isa} macro to ensure that the python-devel dependency on python 2330 | is for the correct multilib arch (#555943) 2331 | - delete bundled copy of libffi to make sure we use the system one 2332 | 2333 | * Fri Jan 15 2010 David Malcolm - 3.1.1-15 2334 | - fix the URLs output by pydoc so they point at python.org's 3.1 build of the 2335 | docs, rather than the 2.6 build 2336 | 2337 | * Wed Jan 13 2010 David Malcolm - 3.1.1-14 2338 | - replace references to /usr with %%{_prefix}; replace references to 2339 | /usr/include with %%{_includedir} (Toshio) 2340 | 2341 | * Mon Jan 11 2010 David Malcolm - 3.1.1-13 2342 | - fix permission on find-provides-without-python-sonames.sh from 775 to 755 2343 | 2344 | * Mon Jan 11 2010 David Malcolm - 3.1.1-12 2345 | - remove build-time requirements on tix and tk, since we already have 2346 | build-time requirements on the -devel subpackages for each of these (Thomas 2347 | Spura) 2348 | - replace usage of %%define with %%global (Thomas Spura) 2349 | - remove forcing of CC=gcc as this old workaround for bug 109268 appears to 2350 | longer be necessary 2351 | - move various test files from the "tools"/"tkinter" subpackages to the "test" 2352 | subpackage 2353 | 2354 | * Thu Jan 7 2010 David Malcolm - 3.1.1-11 2355 | - add %%check section (thanks to Thomas Spura) 2356 | - update patch 4 to use correct shebang line 2357 | - get rid of stray patch file from buildroot 2358 | 2359 | * Tue Nov 17 2009 Andrew McNabb - 3.1.1-10 2360 | - switched a few instances of "find |xargs" to "find -exec" for consistency. 2361 | - made the description of __os_install_post more accurate. 2362 | 2363 | * Wed Nov 4 2009 David Malcolm - 3.1.1-9 2364 | - add macros.python3 to the -devel subpackage, containing common macros for use 2365 | when packaging python3 modules 2366 | 2367 | * Tue Nov 3 2009 David Malcolm - 3.1.1-8 2368 | - add a provides of "python(abi)" (see bug 532118) 2369 | - fix issues identified by a.badger in package review (bug 526126, comment 39): 2370 | - use "3" thoughout metadata, rather than "3.*" 2371 | - remove conditional around "pkg-config openssl" 2372 | - use standard cleanup of RPM_BUILD_ROOT 2373 | - replace hardcoded references to /usr with _prefix macro 2374 | - stop removing egg-info files 2375 | - use /usr/bin/python3.1 rather than /use/bin/env python3.1 when fixing 2376 | up shebang lines 2377 | - stop attempting to remove no-longer-present .cvsignore files 2378 | - move the post/postun sections above the "files" sections 2379 | 2380 | * Thu Oct 29 2009 David Malcolm - 3.1.1-7 2381 | - remove commented-away patch 51 (python-2.6-distutils_rpm.patch): the -O1 2382 | flag is used by default in the upstream code 2383 | - "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py 2384 | _init_posix(), so we include them in the core package, along with their parent 2385 | directories (bug 531901) 2386 | 2387 | * Tue Oct 27 2009 David Malcolm - 3.1.1-6 2388 | - reword description, based on suggestion by amcnabb 2389 | - fix the test_email and test_imp selftests (patch 3 and patch 4 respectively) 2390 | - fix the test_tk and test_ttk_* selftests (patch 5) 2391 | - fix up the specfile's handling of shebang/perms to avoid corrupting 2392 | test_httpservers.py (sed command suggested by amcnabb) 2393 | 2394 | * Thu Oct 22 2009 David Malcolm - 3.1.1-5 2395 | - fixup importlib/_bootstrap.py so that it correctly handles being unable to 2396 | open .pyc files for writing (patch 2, upstream issue 7187) 2397 | - actually apply the rpath patch (patch 1) 2398 | 2399 | * Thu Oct 22 2009 David Malcolm - 3.1.1-4 2400 | - update patch0's setup of the crypt module to link it against libcrypt 2401 | - update patch0 to comment "datetimemodule" back out, so that it is built 2402 | using setup.py (see Setup, option 3), thus linking it statically against 2403 | timemodule.c and thus avoiding a run-time "undefined symbol: 2404 | _PyTime_DoubleToTimet" failure on "import datetime" 2405 | 2406 | * Wed Oct 21 2009 David Malcolm - 3.1.1-3 2407 | - remove executable flag from various files that shouldn't have it 2408 | - fix end-of-line encodings 2409 | - fix a character encoding 2410 | 2411 | * Tue Oct 20 2009 David Malcolm - 3.1.1-2 2412 | - disable invocation of brp-python-bytecompile in postprocessing, since 2413 | it would be with the wrong version of python (adapted from ivazquez' 2414 | python3000 specfile) 2415 | - use a custom implementation of __find_provides in order to filter out bogus 2416 | provides lines for the various .so modules 2417 | - fixup distutils/unixccompiler.py to remove standard library path from rpath 2418 | (patch 1, was Patch0 in ivazquez' python3000 specfile) 2419 | - split out libraries into a -libs subpackage 2420 | - update summaries and descriptions, basing content on ivazquez' specfile 2421 | - fixup executable permissions on .py, .xpm and .xbm files, based on work in 2422 | ivazquez's specfile 2423 | - get rid of DOS batch files 2424 | - fixup permissions for shared libraries from non-standard 555 to standard 755 2425 | - move /usr/bin/python*-config to the -devel subpackage 2426 | - mark various directories as being documentation 2427 | 2428 | * Thu Sep 24 2009 Andrew McNabb 3.1.1-1 2429 | - Initial package for Python 3. 2430 | 2431 | -------------------------------------------------------------------------------- /temporarily-disable-tests-requiring-SIGHUP.patch: -------------------------------------------------------------------------------- 1 | diff -up Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig Python-3.4.0/Lib/test/test_asyncio/test_events.py 2 | --- Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig 2014-04-15 13:18:49.696215288 +0200 3 | +++ Python-3.4.0/Lib/test/test_asyncio/test_events.py 2014-04-15 13:18:56.104258453 +0200 4 | @@ -1528,7 +1528,7 @@ class SubprocessTestsMixin: 5 | self.check_terminated(proto.returncode) 6 | transp.close() 7 | 8 | - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") 9 | + @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") 10 | def test_subprocess_send_signal(self): 11 | prog = os.path.join(os.path.dirname(__file__), 'echo.py') 12 | 13 | 14 | diff -up Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py 15 | --- Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig 2014-04-17 12:03:32.777827520 +0200 16 | +++ Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py 2014-04-17 12:04:37.614210481 +0200 17 | @@ -108,7 +108,7 @@ class SubprocessMixin: 18 | else: 19 | self.assertEqual(-signal.SIGTERM, returncode) 20 | 21 | - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") 22 | + @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") 23 | def test_send_signal(self): 24 | code = 'import time; print("sleeping", flush=True); time.sleep(3600)' 25 | args = [sys.executable, '-c', code] 26 | --------------------------------------------------------------------------------