From d668c1e89cecad767da9798403b1f86892576a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 28 Nov 2017 13:47:21 +0100 Subject: [PATCH 01/67] Python 3.7 (fedpkg prep ok, builds ok without debug) --- 00102-lib64.patch | 41 +- 00111-no-static-lib.patch | 25 +- 00170-gc-assertions.patch | 42 +- 00189-add-rewheel-module.patch | 30 +- 00262-pep538_coerce_legacy_c_locale.patch | 1090 ----------------- 00277-fix-test-subprocess-hanging-tests.patch | 43 - ...mory-corruption-due-to-allocator-mix.patch | 13 - ...ybytecompile3.6 => macros.pybytecompile3.7 | 0 python3.spec | 45 +- 9 files changed, 85 insertions(+), 1244 deletions(-) delete mode 100644 00262-pep538_coerce_legacy_c_locale.patch delete mode 100644 00277-fix-test-subprocess-hanging-tests.patch delete mode 100644 00279-fix-memory-corruption-due-to-allocator-mix.patch rename macros.pybytecompile3.6 => macros.pybytecompile3.7 (100%) diff --git a/00102-lib64.patch b/00102-lib64.patch index 8eea66d..61f9b52 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -1,5 +1,5 @@ diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index 9474e9c..c0ce4c6 100644 +index 0258d3d..4b969bf 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -30,14 +30,14 @@ WINDOWS_SCHEME = { @@ -20,10 +20,10 @@ index 9474e9c..c0ce4c6 100644 'scripts': '$base/bin', 'data' : '$base', diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 026cca7..6d3e077 100644 +index e07a6c8..554740d 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -132,8 +132,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): +@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -37,10 +37,11 @@ index 026cca7..6d3e077 100644 if standard_lib: return libpython else: -diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +index 287ab19..d4c05e0 100644 --- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py -@@ -57,8 +57,9 @@ +@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager, self.assertEqual(got, expected) libdir = os.path.join(destination, "lib", "python") @@ -52,10 +53,10 @@ diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py check_path(cmd.install_headers, os.path.join(destination, "include", "python", "foopkg")) diff --git a/Lib/site.py b/Lib/site.py -index a84e3bb..ba0d3ea 100644 +index 7dc1b04..85016b4 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -303,11 +303,15 @@ def getsitepackages(prefixes=None): +@@ -334,11 +334,15 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': @@ -69,10 +70,10 @@ index a84e3bb..ba0d3ea 100644 sitepackages.append(prefix) + sitepackages.append(os.path.join(prefix, "lib64", "site-packages")) sitepackages.append(os.path.join(prefix, "lib", "site-packages")) - if sys.platform == "darwin": - # for framework builds *only* we add the standard Apple + # for framework builds *only* we add the standard Apple locations. + if sys.platform == "darwin" and sys._framework: diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index b9bbfe5..2a5f29c 100644 +index 9ee4d31..53c8606 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -20,10 +20,10 @@ __all__ = [ @@ -89,7 +90,7 @@ index b9bbfe5..2a5f29c 100644 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': -@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { +@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = { 'data': '{userbase}', }, 'posix_user': { @@ -104,10 +105,10 @@ index b9bbfe5..2a5f29c 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index f698927..bc977b5 100644 +index 99e7b4f..c4c98a6 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py -@@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): +@@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase): self.assertEqual(dirs[1], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc @@ -119,10 +120,10 @@ index f698927..bc977b5 100644 'site-packages') self.assertEqual(dirs[0], wanted) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 8fa7934..a693917 100644 +index e8df8f7..a5a9d5e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -126,7 +126,7 @@ LIBDIR= @libdir@ +@@ -133,7 +133,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -132,7 +133,7 @@ index 8fa7934..a693917 100644 # Detailed destination directories diff --git a/Modules/getpath.c b/Modules/getpath.c -index 65b47a3..eaa756c 100644 +index dd3387a..1258fcd 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -494,7 +494,7 @@ calculate_path(void) @@ -163,10 +164,10 @@ index 65b47a3..eaa756c 100644 /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ diff --git a/setup.py b/setup.py -index 0f2dfc4..da37896 100644 +index 11c4ec6..c3e5512 100644 --- a/setup.py +++ b/setup.py -@@ -492,7 +492,7 @@ class PyBuildExt(build_ext): +@@ -513,7 +513,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -175,7 +176,7 @@ index 0f2dfc4..da37896 100644 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -780,11 +780,11 @@ class PyBuildExt(build_ext): +@@ -809,11 +809,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -189,7 +190,7 @@ index 0f2dfc4..da37896 100644 extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -821,8 +821,8 @@ class PyBuildExt(build_ext): +@@ -850,8 +850,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 6929fda..50cc13a 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,9 +1,9 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in -index 70e5927..04c8e3d 100644 +index a5a9d5e..51e8132 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -556,7 +556,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c - $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make +@@ -530,7 +530,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -11,26 +11,20 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt -@@ -601,18 +601,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -574,12 +574,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - +- -# Build static library --# avoid long command lines, same as LIBRARY_OBJS -$(LIBRARY): $(LIBRARY_OBJS) - -rm -f $@ -- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o -- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) -- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) -- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) Python/frozen.o -- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) -- $(AR) $(ARFLAGS) $@ $(MODOBJS) -- $(RANLIB) $@ +- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) - libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -702,7 +690,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist +@@ -667,7 +661,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi @@ -39,7 +33,7 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1382,18 +1370,6 @@ libainstall: all python-config +@@ -1408,17 +1402,6 @@ libainstall: @DEF_MAKE_RULE@ python-config else true; \ fi; \ done @@ -49,7 +43,6 @@ index 70e5927..04c8e3d 100644 - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ -- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ - fi; \ - else \ - echo Skip install of $(LIBRARY) - use make frameworkinstall; \ diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index f491733..1f71939 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -1,8 +1,8 @@ diff --git a/Include/object.h b/Include/object.h -index 0c88603..e3413e8 100644 +index cb57359..f928f97 100644 --- a/Include/object.h +++ b/Include/object.h -@@ -1059,6 +1059,49 @@ PyAPI_FUNC(void) +@@ -1069,6 +1069,49 @@ PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ @@ -53,7 +53,7 @@ index 0c88603..e3413e8 100644 } #endif diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py -index e727499..6efcafb 100644 +index 904fc7d..5676007 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,10 +1,11 @@ @@ -69,7 +69,7 @@ index e727499..6efcafb 100644 import time import gc import weakref -@@ -50,6 +51,8 @@ class GC_Detector(object): +@@ -46,6 +47,8 @@ class GC_Detector(object): # gc collects it. self.wr = weakref.ref(C1055820(666), it_happened) @@ -78,7 +78,7 @@ index e727499..6efcafb 100644 @with_tp_del class Uncollectable(object): """Create a reference cycle with multiple __del__ methods. -@@ -862,6 +865,50 @@ class GCCallbackTests(unittest.TestCase): +@@ -863,6 +866,50 @@ class GCCallbackTests(unittest.TestCase): self.assertEqual(len(gc.garbage), 0) @@ -130,10 +130,10 @@ index e727499..6efcafb 100644 def setUp(self): gc.enable() diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c -index 0c6f444..87edd5a 100644 +index 6e26c7a..8410206 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c -@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers) +@@ -238,7 +238,8 @@ update_refs(PyGC_Head *containers) { PyGC_Head *gc = containers->gc.gc_next; for (; gc != containers; gc = gc->gc.gc_next) { @@ -143,7 +143,7 @@ index 0c6f444..87edd5a 100644 _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); /* Python's cyclic gc should never see an incoming refcount * of 0: if something decref'ed to 0, it should have been -@@ -361,7 +362,8 @@ update_refs(PyGC_Head *containers) +@@ -258,7 +259,8 @@ update_refs(PyGC_Head *containers) * so serious that maybe this should be a release-build * check instead of an assert? */ @@ -153,7 +153,7 @@ index 0c6f444..87edd5a 100644 } } -@@ -376,7 +378,9 @@ visit_decref(PyObject *op, void *data) +@@ -273,7 +275,9 @@ visit_decref(PyObject *op, void *data) * generation being collected, which can be recognized * because only they have positive gc_refs. */ @@ -164,7 +164,7 @@ index 0c6f444..87edd5a 100644 if (_PyGCHead_REFS(gc) > 0) _PyGCHead_DECREF(gc); } -@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) +@@ -333,9 +337,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) * If gc_refs == GC_UNTRACKED, it must be ignored. */ else { @@ -178,7 +178,7 @@ index 0c6f444..87edd5a 100644 } } return 0; -@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) +@@ -377,7 +382,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) */ PyObject *op = FROM_GC(gc); traverseproc traverse = Py_TYPE(op)->tp_traverse; @@ -187,7 +187,7 @@ index 0c6f444..87edd5a 100644 _PyGCHead_SET_REFS(gc, GC_REACHABLE); (void) traverse(op, (visitproc)visit_reachable, -@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) +@@ -440,7 +445,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); @@ -196,7 +196,7 @@ index 0c6f444..87edd5a 100644 next = gc->gc.gc_next; if (has_legacy_finalizer(op)) { -@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -516,7 +521,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) PyWeakReference **wrlist; op = FROM_GC(gc); @@ -205,7 +205,7 @@ index 0c6f444..87edd5a 100644 next = gc->gc.gc_next; if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) -@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -537,9 +542,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) * the callback pointer intact. Obscure: it also * changes *wrlist. */ @@ -217,7 +217,7 @@ index 0c6f444..87edd5a 100644 if (wr->wr_callback == NULL) continue; /* no callback */ -@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -573,7 +578,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) */ if (IS_TENTATIVELY_UNREACHABLE(wr)) continue; @@ -226,7 +226,7 @@ index 0c6f444..87edd5a 100644 /* Create a new reference so that wr can't go away * before we can process it again. -@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -582,7 +587,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) /* Move wr to wrcb_to_call, for the next pass. */ wrasgc = AS_GC(wr); @@ -236,7 +236,7 @@ index 0c6f444..87edd5a 100644 next isn't, so they can't be the same */ gc_list_move(wrasgc, &wrcb_to_call); -@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -598,11 +604,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) gc = wrcb_to_call.gc.gc_next; op = FROM_GC(gc); @@ -251,7 +251,7 @@ index 0c6f444..87edd5a 100644 /* copy-paste of weakrefobject.c's handle_callback() */ temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); -@@ -822,12 +828,14 @@ check_garbage(PyGC_Head *collectable) +@@ -719,12 +725,14 @@ check_garbage(PyGC_Head *collectable) for (gc = collectable->gc.gc_next; gc != collectable; gc = gc->gc.gc_next) { _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); @@ -269,11 +269,11 @@ index 0c6f444..87edd5a 100644 return -1; } diff --git a/Objects/object.c b/Objects/object.c -index 559794f..a47d47f 100644 +index ed8a62a..5279b15 100644 --- a/Objects/object.c +++ b/Objects/object.c -@@ -2022,6 +2022,35 @@ _PyTrash_thread_destroy_chain(void) - } +@@ -2116,6 +2116,35 @@ _PyTrash_thread_destroy_chain(void) + --tstate->trash_delete_nesting; } +PyAPI_FUNC(void) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index 53a26ca..bae64d4 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -1,6 +1,7 @@ -diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/__init__.py ---- Python-3.4.1/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200 -+++ Python-3.4.1-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200 +diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py +index d69e09f..5cb12df 100644 +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py @@ -1,8 +1,10 @@ import os import os.path @@ -12,16 +13,16 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure __all__ = ["version", "bootstrap"] -@@ -38,6 +40,8 @@ +@@ -25,6 +27,8 @@ def _run_pip(args, additional_paths=None): # Install the bundled software import pip + if args[0] in ["install", "list", "wheel"]: + args.append('--pre') - pip.main(args) + return pip.main(args) -@@ -87,20 +91,39 @@ +@@ -88,20 +92,39 @@ def _bootstrap(*, root=None, upgrade=False, user=False, # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -71,9 +72,11 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] -diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py ---- Python-3.4.1/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 -+++ Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-08-21 10:11:22.560320121 +0200 +diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py +new file mode 100644 +index 0000000..753c764 +--- /dev/null ++++ b/Lib/ensurepip/rewheel/__init__.py @@ -0,0 +1,143 @@ +import argparse +import codecs @@ -218,10 +221,11 @@ diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Li + else: + pass # bad RECORD or empty line + return to_write, to_omit -diff -Nur Python-3.4.1/Makefile.pre.in Python-3.4.1-rewheel/Makefile.pre.in ---- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200 -+++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200 -@@ -1145,7 +1145,7 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 51e8132..42b3d29 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1241,7 +1241,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_asyncio \ collections concurrent concurrent/futures encodings \ email email/mime test/test_email test/test_email/data \ diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch deleted file mode 100644 index d749bac..0000000 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ /dev/null @@ -1,1090 +0,0 @@ -diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index 195f63f..8ecd70f 100644 ---- a/Doc/using/cmdline.rst -+++ b/Doc/using/cmdline.rst -@@ -713,6 +713,45 @@ conflict. - - .. versionadded:: 3.6 - -+ -+.. envvar:: PYTHONCOERCECLOCALE -+ -+ If set to the value ``0``, causes the main Python command line application -+ to skip coercing the legacy ASCII-based C locale to a more capable UTF-8 -+ based alternative. Note that this setting is checked even when the -+ :option:`-E` or :option:`-I` options are used, as it is handled prior to -+ the processing of command line options. -+ -+ If this variable is *not* set, or is set to a value other than ``0``, and -+ the current locale reported for the ``LC_CTYPE`` category is the default -+ ``C`` locale, then the Python CLI will attempt to configure one of the -+ following locales for the given locale categories before loading the -+ interpreter runtime: -+ -+ * ``C.UTF-8`` (``LC_ALL``) -+ * ``C.utf8`` (``LC_ALL``) -+ * ``UTF-8`` (``LC_CTYPE``) -+ -+ If setting one of these locale categories succeeds, then the matching -+ environment variables will be set (both ``LC_ALL`` and ``LANG`` for the -+ ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category) in -+ the current process environment before the Python runtime is initialized. -+ -+ Configuring one of these locales (either explicitly or via the above -+ implicit locale coercion) will automatically set the error handler for -+ :data:`sys.stdin` and :data:`sys.stdout` to ``surrogateescape``. This -+ behavior can be overridden using :envvar:`PYTHONIOENCODING` as usual. -+ -+ For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause -+ Python to emit warning messages on ``stderr`` if either the locale coercion -+ activates, or else if a locale that *would* have triggered coercion is -+ still active when the Python runtime is initialized. -+ -+ Availability: \*nix -+ -+ .. versionadded:: 3.7 -+ See :pep:`538` for more details. -+ - Debug-mode variables - ~~~~~~~~~~~~~~~~~~~~ - -diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py -index ca5f9c2..7aa460b 100644 ---- a/Lib/test/support/script_helper.py -+++ b/Lib/test/support/script_helper.py -@@ -51,8 +51,35 @@ def interpreter_requires_environment(): - return __cached_interp_requires_environment - - --_PythonRunResult = collections.namedtuple("_PythonRunResult", -- ("rc", "out", "err")) -+class _PythonRunResult(collections.namedtuple("_PythonRunResult", -+ ("rc", "out", "err"))): -+ """Helper for reporting Python subprocess run results""" -+ def fail(self, cmd_line): -+ """Provide helpful details about failed subcommand runs""" -+ # Limit to 80 lines to ASCII characters -+ maxlen = 80 * 100 -+ out, err = self.out, self.err -+ if len(out) > maxlen: -+ out = b'(... truncated stdout ...)' + out[-maxlen:] -+ if len(err) > maxlen: -+ err = b'(... truncated stderr ...)' + err[-maxlen:] -+ out = out.decode('ascii', 'replace').rstrip() -+ err = err.decode('ascii', 'replace').rstrip() -+ raise AssertionError("Process return code is %d\n" -+ "command line: %r\n" -+ "\n" -+ "stdout:\n" -+ "---\n" -+ "%s\n" -+ "---\n" -+ "\n" -+ "stderr:\n" -+ "---\n" -+ "%s\n" -+ "---" -+ % (self.rc, cmd_line, -+ out, -+ err)) - - - # Executing the interpreter in a subprocess -@@ -110,30 +137,7 @@ def run_python_until_end(*args, **env_vars): - def _assert_python(expected_success, *args, **env_vars): - res, cmd_line = run_python_until_end(*args, **env_vars) - if (res.rc and expected_success) or (not res.rc and not expected_success): -- # Limit to 80 lines to ASCII characters -- maxlen = 80 * 100 -- out, err = res.out, res.err -- if len(out) > maxlen: -- out = b'(... truncated stdout ...)' + out[-maxlen:] -- if len(err) > maxlen: -- err = b'(... truncated stderr ...)' + err[-maxlen:] -- out = out.decode('ascii', 'replace').rstrip() -- err = err.decode('ascii', 'replace').rstrip() -- raise AssertionError("Process return code is %d\n" -- "command line: %r\n" -- "\n" -- "stdout:\n" -- "---\n" -- "%s\n" -- "---\n" -- "\n" -- "stderr:\n" -- "---\n" -- "%s\n" -- "---" -- % (res.rc, cmd_line, -- out, -- err)) -+ res.fail(cmd_line) - return res - - def assert_python_ok(*args, **env_vars): -diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py -new file mode 100644 -index 0000000..635c98f ---- /dev/null -+++ b/Lib/test/test_c_locale_coercion.py -@@ -0,0 +1,371 @@ -+# Tests the attempted automatic coercion of the C locale to a UTF-8 locale -+ -+import unittest -+import locale -+import os -+import sys -+import sysconfig -+import shutil -+import subprocess -+from collections import namedtuple -+ -+import test.support -+from test.support.script_helper import ( -+ run_python_until_end, -+ interpreter_requires_environment, -+) -+ -+# Set our expectation for the default encoding used in the C locale -+# for the filesystem encoding and the standard streams -+ -+# AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII -+if sys.platform.startswith("aix"): -+ C_LOCALE_STREAM_ENCODING = "iso8859-1" -+else: -+ C_LOCALE_STREAM_ENCODING = "ascii" -+ -+# FS encoding is UTF-8 on macOS, other *nix platforms use the locale encoding -+if sys.platform == "darwin": -+ C_LOCALE_FS_ENCODING = "utf-8" -+else: -+ C_LOCALE_FS_ENCODING = C_LOCALE_STREAM_ENCODING -+ -+# Note that the above is probably still wrong in some cases, such as: -+# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set -+# * AIX and any other platforms that use latin-1 in the C locale -+# -+# Options for dealing with this: -+# * Don't set PYTHON_COERCE_C_LOCALE on such platforms (e.g. Windows doesn't) -+# * Fix the test expectations to match the actual platform behaviour -+ -+# In order to get the warning messages to match up as expected, the candidate -+# order here must much the target locale order in Python/pylifecycle.c -+_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8", "UTF-8") -+ -+# There's no reliable cross-platform way of checking locale alias -+# lists, so the only way of knowing which of these locales will work -+# is to try them with locale.setlocale(). We do that in a subprocess -+# to avoid altering the locale of the test runner. -+# -+# If the relevant locale module attributes exist, and we're not on a platform -+# where we expect it to always succeed, we also check that -+# `locale.nl_langinfo(locale.CODESET)` works, as if it fails, the interpreter -+# will skip locale coercion for that particular target locale -+_check_nl_langinfo_CODESET = bool( -+ sys.platform not in ("darwin", "linux") and -+ hasattr(locale, "nl_langinfo") and -+ hasattr(locale, "CODESET") -+) -+ -+def _set_locale_in_subprocess(locale_name): -+ cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))" -+ if _check_nl_langinfo_CODESET: -+ # If there's no valid CODESET, we expect coercion to be skipped -+ cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))" -+ cmd = cmd_fmt.format(locale_name) -+ result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) -+ return result.rc == 0 -+ -+ -+ -+_fields = "fsencoding stdin_info stdout_info stderr_info lang lc_ctype lc_all" -+_EncodingDetails = namedtuple("EncodingDetails", _fields) -+ -+class EncodingDetails(_EncodingDetails): -+ # XXX (ncoghlan): Using JSON for child state reporting may be less fragile -+ CHILD_PROCESS_SCRIPT = ";".join([ -+ "import sys, os", -+ "print(sys.getfilesystemencoding())", -+ "print(sys.stdin.encoding + ':' + sys.stdin.errors)", -+ "print(sys.stdout.encoding + ':' + sys.stdout.errors)", -+ "print(sys.stderr.encoding + ':' + sys.stderr.errors)", -+ "print(os.environ.get('LANG', 'not set'))", -+ "print(os.environ.get('LC_CTYPE', 'not set'))", -+ "print(os.environ.get('LC_ALL', 'not set'))", -+ ]) -+ -+ @classmethod -+ def get_expected_details(cls, coercion_expected, fs_encoding, stream_encoding, env_vars): -+ """Returns expected child process details for a given encoding""" -+ _stream = stream_encoding + ":{}" -+ # stdin and stdout should use surrogateescape either because the -+ # coercion triggered, or because the C locale was detected -+ stream_info = 2*[_stream.format("surrogateescape")] -+ # stderr should always use backslashreplace -+ stream_info.append(_stream.format("backslashreplace")) -+ expected_lang = env_vars.get("LANG", "not set").lower() -+ if coercion_expected: -+ expected_lc_ctype = CLI_COERCION_TARGET.lower() -+ else: -+ expected_lc_ctype = env_vars.get("LC_CTYPE", "not set").lower() -+ expected_lc_all = env_vars.get("LC_ALL", "not set").lower() -+ env_info = expected_lang, expected_lc_ctype, expected_lc_all -+ return dict(cls(fs_encoding, *stream_info, *env_info)._asdict()) -+ -+ @staticmethod -+ def _handle_output_variations(data): -+ """Adjust the output to handle platform specific idiosyncrasies -+ -+ * Some platforms report ASCII as ANSI_X3.4-1968 -+ * Some platforms report ASCII as US-ASCII -+ * Some platforms report UTF-8 instead of utf-8 -+ """ -+ data = data.replace(b"ANSI_X3.4-1968", b"ascii") -+ data = data.replace(b"US-ASCII", b"ascii") -+ data = data.lower() -+ return data -+ -+ @classmethod -+ def get_child_details(cls, env_vars): -+ """Retrieves fsencoding and standard stream details from a child process -+ -+ Returns (encoding_details, stderr_lines): -+ -+ - encoding_details: EncodingDetails for eager decoding -+ - stderr_lines: result of calling splitlines() on the stderr output -+ -+ The child is run in isolated mode if the current interpreter supports -+ that. -+ """ -+ result, py_cmd = run_python_until_end( -+ "-c", cls.CHILD_PROCESS_SCRIPT, -+ __isolated=True, -+ **env_vars -+ ) -+ if not result.rc == 0: -+ result.fail(py_cmd) -+ # All subprocess outputs in this test case should be pure ASCII -+ adjusted_output = cls._handle_output_variations(result.out) -+ stdout_lines = adjusted_output.decode("ascii").splitlines() -+ child_encoding_details = dict(cls(*stdout_lines)._asdict()) -+ stderr_lines = result.err.decode("ascii").rstrip().splitlines() -+ return child_encoding_details, stderr_lines -+ -+ -+# Details of the shared library warning emitted at runtime -+LEGACY_LOCALE_WARNING = ( -+ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " -+ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " -+ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " -+ "locales is recommended." -+) -+ -+# Details of the CLI locale coercion warning emitted at runtime -+CLI_COERCION_WARNING_FMT = ( -+ "Python detected LC_CTYPE=C: LC_CTYPE coerced to {} (set another locale " -+ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior)." -+) -+ -+ -+AVAILABLE_TARGETS = None -+CLI_COERCION_TARGET = None -+CLI_COERCION_WARNING = None -+ -+def setUpModule(): -+ global AVAILABLE_TARGETS -+ global CLI_COERCION_TARGET -+ global CLI_COERCION_WARNING -+ -+ if AVAILABLE_TARGETS is not None: -+ # initialization already done -+ return -+ AVAILABLE_TARGETS = [] -+ -+ # Find the target locales available in the current system -+ for target_locale in _C_UTF8_LOCALES: -+ if _set_locale_in_subprocess(target_locale): -+ AVAILABLE_TARGETS.append(target_locale) -+ -+ if AVAILABLE_TARGETS: -+ # Coercion is expected to use the first available target locale -+ CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] -+ CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) -+ -+ -+class _LocaleHandlingTestCase(unittest.TestCase): -+ # Base class to check expected locale handling behaviour -+ -+ def _check_child_encoding_details(self, -+ env_vars, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ expected_warnings, -+ coercion_expected): -+ """Check the C locale handling for the given process environment -+ -+ Parameters: -+ expected_fs_encoding: expected sys.getfilesystemencoding() result -+ expected_stream_encoding: expected encoding for standard streams -+ expected_warning: stderr output to expect (if any) -+ """ -+ result = EncodingDetails.get_child_details(env_vars) -+ encoding_details, stderr_lines = result -+ expected_details = EncodingDetails.get_expected_details( -+ coercion_expected, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ env_vars -+ ) -+ self.assertEqual(encoding_details, expected_details) -+ if expected_warnings is None: -+ expected_warnings = [] -+ self.assertEqual(stderr_lines, expected_warnings) -+ -+ -+class LocaleConfigurationTests(_LocaleHandlingTestCase): -+ # Test explicit external configuration via the process environment -+ -+ def setUpClass(): -+ # This relies on setupModule() having been run, so it can't be -+ # handled via the @unittest.skipUnless decorator -+ if not AVAILABLE_TARGETS: -+ raise unittest.SkipTest("No C-with-UTF-8 locale available") -+ -+ def test_external_target_locale_configuration(self): -+ -+ # Explicitly setting a target locale should give the same behaviour as -+ # is seen when implicitly coercing to that target locale -+ self.maxDiff = None -+ -+ expected_fs_encoding = "utf-8" -+ expected_stream_encoding = "utf-8" -+ -+ base_var_dict = { -+ "LANG": "", -+ "LC_CTYPE": "", -+ "LC_ALL": "", -+ } -+ for env_var in ("LANG", "LC_CTYPE"): -+ for locale_to_set in AVAILABLE_TARGETS: -+ # XXX (ncoghlan): LANG=UTF-8 doesn't appear to work as -+ # expected, so skip that combination for now -+ # See https://bugs.python.org/issue30672 for discussion -+ if env_var == "LANG" and locale_to_set == "UTF-8": -+ continue -+ -+ with self.subTest(env_var=env_var, -+ configured_locale=locale_to_set): -+ var_dict = base_var_dict.copy() -+ var_dict[env_var] = locale_to_set -+ self._check_child_encoding_details(var_dict, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ expected_warnings=None, -+ coercion_expected=False) -+ -+ -+ -+@test.support.cpython_only -+@unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), -+ "C locale coercion disabled at build time") -+class LocaleCoercionTests(_LocaleHandlingTestCase): -+ # Test implicit reconfiguration of the environment during CLI startup -+ -+ def _check_c_locale_coercion(self, -+ fs_encoding, stream_encoding, -+ coerce_c_locale, -+ expected_warnings=None, -+ coercion_expected=True, -+ **extra_vars): -+ """Check the C locale handling for various configurations -+ -+ Parameters: -+ fs_encoding: expected sys.getfilesystemencoding() result -+ stream_encoding: expected encoding for standard streams -+ coerce_c_locale: setting to use for PYTHONCOERCECLOCALE -+ None: don't set the variable at all -+ str: the value set in the child's environment -+ expected_warnings: expected warning lines on stderr -+ extra_vars: additional environment variables to set in subprocess -+ """ -+ self.maxDiff = None -+ -+ if not AVAILABLE_TARGETS: -+ # Locale coercion is disabled when there aren't any target locales -+ fs_encoding = C_LOCALE_FS_ENCODING -+ stream_encoding = C_LOCALE_STREAM_ENCODING -+ coercion_expected = False -+ if expected_warnings: -+ expected_warnings = [LEGACY_LOCALE_WARNING] -+ -+ base_var_dict = { -+ "LANG": "", -+ "LC_CTYPE": "", -+ "LC_ALL": "", -+ } -+ base_var_dict.update(extra_vars) -+ for env_var in ("LANG", "LC_CTYPE"): -+ for locale_to_set in ("", "C", "POSIX", "invalid.ascii"): -+ # XXX (ncoghlan): *BSD platforms don't behave as expected in the -+ # POSIX locale, so we skip that for now -+ # See https://bugs.python.org/issue30672 for discussion -+ if locale_to_set == "POSIX": -+ continue -+ with self.subTest(env_var=env_var, -+ nominal_locale=locale_to_set, -+ PYTHONCOERCECLOCALE=coerce_c_locale): -+ var_dict = base_var_dict.copy() -+ var_dict[env_var] = locale_to_set -+ if coerce_c_locale is not None: -+ var_dict["PYTHONCOERCECLOCALE"] = coerce_c_locale -+ # Check behaviour on successful coercion -+ self._check_child_encoding_details(var_dict, -+ fs_encoding, -+ stream_encoding, -+ expected_warnings, -+ coercion_expected) -+ -+ def test_test_PYTHONCOERCECLOCALE_not_set(self): -+ # This should coerce to the first available target locale by default -+ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=None) -+ -+ def test_PYTHONCOERCECLOCALE_not_zero(self): -+ # *Any* string other than "0" is considered "set" for our purposes -+ # and hence should result in the locale coercion being enabled -+ for setting in ("", "1", "true", "false"): -+ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=setting) -+ -+ def test_PYTHONCOERCECLOCALE_set_to_warn(self): -+ # PYTHONCOERCECLOCALE=warn enables runtime warnings for legacy locales -+ self._check_c_locale_coercion("utf-8", "utf-8", -+ coerce_c_locale="warn", -+ expected_warnings=[CLI_COERCION_WARNING]) -+ -+ -+ def test_PYTHONCOERCECLOCALE_set_to_zero(self): -+ # The setting "0" should result in the locale coercion being disabled -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="0", -+ coercion_expected=False) -+ # Setting LC_ALL=C shouldn't make any difference to the behaviour -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="0", -+ LC_ALL="C", -+ coercion_expected=False) -+ -+ def test_LC_ALL_set_to_C(self): -+ # Setting LC_ALL should render the locale coercion ineffective -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale=None, -+ LC_ALL="C", -+ coercion_expected=False) -+ # And result in a warning about a lack of locale compatibility -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="warn", -+ LC_ALL="C", -+ expected_warnings=[LEGACY_LOCALE_WARNING], -+ coercion_expected=False) -+ -+def test_main(): -+ test.support.run_unittest( -+ LocaleConfigurationTests, -+ LocaleCoercionTests -+ ) -+ test.support.reap_children() -+ -+if __name__ == "__main__": -+ test_main() -diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 6c3625d..009f542 100644 ---- a/Lib/test/test_capi.py -+++ b/Lib/test/test_capi.py -@@ -369,14 +369,21 @@ class EmbeddingTests(unittest.TestCase): - def tearDown(self): - os.chdir(self.oldcwd) - -- def run_embedded_interpreter(self, *args): -+ def run_embedded_interpreter(self, *args, env=None): - """Runs a test in the embedded interpreter""" - cmd = [self.test_exe] - cmd.extend(args) -+ if env is not None and sys.platform == 'win32': -+ # Windows requires at least the SYSTEMROOT environment variable to -+ # start Python. -+ env = env.copy() -+ env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] -+ - p = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, -- universal_newlines=True) -+ universal_newlines=True, -+ env=env) - (out, err) = p.communicate() - self.assertEqual(p.returncode, 0, - "bad returncode %d, stderr is %r" % -@@ -386,31 +393,21 @@ class EmbeddingTests(unittest.TestCase): - def test_subinterps(self): - # This is just a "don't crash" test - out, err = self.run_embedded_interpreter() -- if support.verbose: -+ if support.verbose > 1: - print() - print(out) - print(err) - -- @staticmethod -- def _get_default_pipe_encoding(): -- rp, wp = os.pipe() -- try: -- with os.fdopen(wp, 'w') as w: -- default_pipe_encoding = w.encoding -- finally: -- os.close(rp) -- return default_pipe_encoding -- - def test_forced_io_encoding(self): - # Checks forced configuration of embedded interpreter IO streams -- out, err = self.run_embedded_interpreter("forced_io_encoding") -- if support.verbose: -+ env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") -+ out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) -+ if support.verbose > 1: - print() - print(out) - print(err) -- expected_errors = sys.__stdout__.errors -- expected_stdin_encoding = sys.__stdin__.encoding -- expected_pipe_encoding = self._get_default_pipe_encoding() -+ expected_stream_encoding = "utf-8" -+ expected_errors = "surrogateescape" - expected_output = '\n'.join([ - "--- Use defaults ---", - "Expected encoding: default", -@@ -437,8 +434,8 @@ class EmbeddingTests(unittest.TestCase): - "stdout: latin-1:replace", - "stderr: latin-1:backslashreplace"]) - expected_output = expected_output.format( -- in_encoding=expected_stdin_encoding, -- out_encoding=expected_pipe_encoding, -+ in_encoding=expected_stream_encoding, -+ out_encoding=expected_stream_encoding, - errors=expected_errors) - # This is useful if we ever trip over odd platform behaviour - self.maxDiff = None -diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py -index ae2bcd4..0a302ff 100644 ---- a/Lib/test/test_cmd_line.py -+++ b/Lib/test/test_cmd_line.py -@@ -9,8 +9,9 @@ import sys - import subprocess - import tempfile - from test.support import script_helper, is_android --from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, -- assert_python_failure) -+from test.support.script_helper import ( -+ spawn_python, kill_python, assert_python_ok, assert_python_failure -+) - - - # XXX (ncoghlan): Move to script_helper and make consistent with run_python -@@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): - env = os.environ.copy() - # Use C locale to get ascii for the locale encoding - env['LC_ALL'] = 'C' -+ env['PYTHONCOERCECLOCALE'] = '0' - code = ( - b'import locale; ' - b'print(ascii("' + undecodable + b'"), ' -diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py -index df9ebd4..63145e4 100644 ---- a/Lib/test/test_sys.py -+++ b/Lib/test/test_sys.py -@@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): - # Force the POSIX locale - env = os.environ.copy() - env["LC_ALL"] = "C" -+ env["PYTHONCOERCECLOCALE"] = "0" - code = '\n'.join(( - 'import sys', - 'def dump(name):', -diff --git a/Modules/main.c b/Modules/main.c -index dd50211..f20cf24 100644 ---- a/Modules/main.c -+++ b/Modules/main.c -@@ -105,7 +105,11 @@ static const char usage_6[] = - " predictable seed.\n" - "PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" - " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" --" hooks.\n"; -+" hooks.\n" -+ -+"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" -+" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" -+" locale coercion and locale compatibility warnings on stderr.\n"; - - static int - usage(int exitcode, const wchar_t* program) -diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index 3968399..1bd2bbf 100644 ---- a/Programs/_testembed.c -+++ b/Programs/_testembed.c -@@ -1,4 +1,5 @@ --#include -+#include "Python.h" -+#include "pyconfig.h" - #include - - /********************************************************* -diff --git a/Programs/python.c b/Programs/python.c -index a7afbc7..03f8295 100644 ---- a/Programs/python.c -+++ b/Programs/python.c -@@ -15,6 +15,21 @@ wmain(int argc, wchar_t **argv) - } - #else - -+/* Access private pylifecycle helper API to better handle the legacy C locale -+ * -+ * The legacy C locale assumes ASCII as the default text encoding, which -+ * causes problems not only for the CPython runtime, but also other -+ * components like GNU readline. -+ * -+ * Accordingly, when the CLI detects it, it attempts to coerce it to a -+ * more capable UTF-8 based alternative. -+ * -+ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. -+ * -+ */ -+extern int _Py_LegacyLocaleDetected(void); -+extern void _Py_CoerceLegacyLocale(void); -+ - int - main(int argc, char **argv) - { -@@ -25,7 +40,11 @@ main(int argc, char **argv) - char *oldloc; - - /* Force malloc() allocator to bootstrap Python */ -+#ifdef Py_DEBUG -+ (void)_PyMem_SetupAllocators("malloc_debug"); -+# else - (void)_PyMem_SetupAllocators("malloc"); -+# endif - - argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); - argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); -@@ -49,7 +68,21 @@ main(int argc, char **argv) - return 1; - } - -+#ifdef __ANDROID__ -+ /* Passing "" to setlocale() on Android requests the C locale rather -+ * than checking environment variables, so request C.UTF-8 explicitly -+ */ -+ setlocale(LC_ALL, "C.UTF-8"); -+#else -+ /* Reconfigure the locale to the default for this process */ - setlocale(LC_ALL, ""); -+#endif -+ -+ if (_Py_LegacyLocaleDetected()) { -+ _Py_CoerceLegacyLocale(); -+ } -+ -+ /* Convert from char to wchar_t based on the locale settings */ - for (i = 0; i < argc; i++) { - argv_copy[i] = Py_DecodeLocale(argv[i], NULL); - if (!argv_copy[i]) { -@@ -70,7 +103,11 @@ main(int argc, char **argv) - - /* Force again malloc() allocator to release memory blocks allocated - before Py_Main() */ -+#ifdef Py_DEBUG -+ (void)_PyMem_SetupAllocators("malloc_debug"); -+# else - (void)_PyMem_SetupAllocators("malloc"); -+# endif - - for (i = 0; i < argc; i++) { - PyMem_RawFree(argv_copy2[i]); -diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..3843297 100644 ---- a/Python/pylifecycle.c -+++ b/Python/pylifecycle.c -@@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) - return 0; - } - -+ - /* Global initializations. Can be undone by Py_FinalizeEx(). Don't - call this twice without an intervening Py_FinalizeEx() call. When - initializations fail, a fatal error is issued and the function does -@@ -301,6 +302,183 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) - } - - -+/* Helper functions to better handle the legacy C locale -+ * -+ * The legacy C locale assumes ASCII as the default text encoding, which -+ * causes problems not only for the CPython runtime, but also other -+ * components like GNU readline. -+ * -+ * Accordingly, when the CLI detects it, it attempts to coerce it to a -+ * more capable UTF-8 based alternative as follows: -+ * -+ * if (_Py_LegacyLocaleDetected()) { -+ * _Py_CoerceLegacyLocale(); -+ * } -+ * -+ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. -+ * -+ * Locale coercion also impacts the default error handler for the standard -+ * streams: while the usual default is "strict", the default for the legacy -+ * C locale and for any of the coercion target locales is "surrogateescape". -+ */ -+ -+int -+_Py_LegacyLocaleDetected(void) -+{ -+#ifndef MS_WINDOWS -+ /* On non-Windows systems, the C locale is considered a legacy locale */ -+ /* XXX (ncoghlan): some platforms (notably Mac OS X) don't appear to treat -+ * the POSIX locale as a simple alias for the C locale, so -+ * we may also want to check for that explicitly. -+ */ -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ return ctype_loc != NULL && strcmp(ctype_loc, "C") == 0; -+#else -+ /* Windows uses code pages instead of locales, so no locale is legacy */ -+ return 0; -+#endif -+} -+ -+ -+static const char *_C_LOCALE_WARNING = -+ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " -+ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " -+ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " -+ "locales is recommended.\n"; -+ -+static int -+_legacy_locale_warnings_enabled(void) -+{ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ return (coerce_c_locale != NULL && -+ strncmp(coerce_c_locale, "warn", 5) == 0); -+} -+ -+static void -+_emit_stderr_warning_for_legacy_locale(void) -+{ -+ if (_legacy_locale_warnings_enabled()) { -+ if (_Py_LegacyLocaleDetected()) { -+ fprintf(stderr, "%s", _C_LOCALE_WARNING); -+ } -+ } -+} -+ -+typedef struct _CandidateLocale { -+ const char *locale_name; /* The locale to try as a coercion target */ -+} _LocaleCoercionTarget; -+ -+static _LocaleCoercionTarget _TARGET_LOCALES[] = { -+ {"C.UTF-8"}, -+ {"C.utf8"}, -+ {"UTF-8"}, -+ {NULL} -+}; -+ -+static char * -+get_default_standard_stream_error_handler(void) -+{ -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ if (ctype_loc != NULL) { -+ /* "surrogateescape" is the default in the legacy C locale */ -+ if (strcmp(ctype_loc, "C") == 0) { -+ return "surrogateescape"; -+ } -+ -+#ifdef PY_COERCE_C_LOCALE -+ /* "surrogateescape" is the default in locale coercion target locales */ -+ const _LocaleCoercionTarget *target = NULL; -+ for (target = _TARGET_LOCALES; target->locale_name; target++) { -+ if (strcmp(ctype_loc, target->locale_name) == 0) { -+ return "surrogateescape"; -+ } -+ } -+#endif -+ } -+ -+ /* Otherwise return NULL to request the typical default error handler */ -+ return NULL; -+} -+ -+#ifdef PY_COERCE_C_LOCALE -+static const char *_C_LOCALE_COERCION_WARNING = -+ "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale " -+ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; -+ -+static void -+_coerce_default_locale_settings(const _LocaleCoercionTarget *target) -+{ -+ -+ const char *newloc = target->locale_name; -+ -+ /* Reset locale back to currently configured defaults */ -+ setlocale(LC_ALL, ""); -+ -+ /* Set the relevant locale environment variable */ -+ if (setenv("LC_CTYPE", newloc, 1)) { -+ fprintf(stderr, -+ "Error setting LC_CTYPE, skipping C locale coercion\n"); -+ return; -+ } -+ if (_legacy_locale_warnings_enabled()) { -+ fprintf(stderr, _C_LOCALE_COERCION_WARNING, newloc); -+ } -+ -+ /* Reconfigure with the overridden environment variables */ -+ setlocale(LC_ALL, ""); -+} -+#endif -+ -+ -+void -+_Py_CoerceLegacyLocale(void) -+{ -+#ifdef PY_COERCE_C_LOCALE -+ /* We ignore the Python -E and -I flags here, as the CLI needs to sort out -+ * the locale settings *before* we try to do anything with the command -+ * line arguments. For cross-platform debugging purposes, we also need -+ * to give end users a way to force even scripts that are otherwise -+ * isolated from their environment to use the legacy ASCII-centric C -+ * locale. -+ * -+ * Ignoring -E and -I is safe from a security perspective, as we only use -+ * the setting to turn *off* the implicit locale coercion, and anyone with -+ * access to the process environment already has the ability to set -+ * `LC_ALL=C` to override the C level locale settings anyway. -+ */ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { -+ /* PYTHONCOERCECLOCALE is not set, or is set to something other than "0" */ -+ const char *locale_override = getenv("LC_ALL"); -+ if (locale_override == NULL || *locale_override == '\0') { -+ /* LC_ALL is also not set (or is set to an empty string) */ -+ const _LocaleCoercionTarget *target = NULL; -+ for (target = _TARGET_LOCALES; target->locale_name; target++) { -+ const char *new_locale = setlocale(LC_CTYPE, -+ target->locale_name); -+ if (new_locale != NULL) { -+#if !defined(__APPLE__) && defined(HAVE_LANGINFO_H) && defined(CODESET) -+ /* Also ensure that nl_langinfo works in this locale */ -+ char *codeset = nl_langinfo(CODESET); -+ if (!codeset || *codeset == '\0') { -+ /* CODESET is not set or empty, so skip coercion */ -+ new_locale = NULL; -+ setlocale(LC_CTYPE, ""); -+ continue; -+ } -+#endif -+ /* Successfully configured locale, so make it the default */ -+ _coerce_default_locale_settings(target); -+ return; -+ } -+ } -+ } -+ } -+ /* No C locale warning here, as Py_Initialize will emit one later */ -+#endif -+} -+ -+ - void - _Py_InitializeEx_Private(int install_sigs, int install_importlib) - { -@@ -315,11 +493,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) - initialized = 1; - _Py_Finalizing = NULL; - --#ifdef HAVE_SETLOCALE -+#ifdef __ANDROID__ -+ /* Passing "" to setlocale() on Android requests the C locale rather -+ * than checking environment variables, so request C.UTF-8 explicitly -+ */ -+ setlocale(LC_CTYPE, "C.UTF-8"); -+#else -+#ifndef MS_WINDOWS - /* Set up the LC_CTYPE locale, so we can obtain - the locale's charset without having to switch - locales. */ - setlocale(LC_CTYPE, ""); -+ _emit_stderr_warning_for_legacy_locale(); -+#endif - #endif - - if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1242,12 +1428,8 @@ initstdio(void) - } - } - if (!errors && !(pythonioencoding && *pythonioencoding)) { -- /* When the LC_CTYPE locale is the POSIX locale ("C locale"), -- stdin and stdout use the surrogateescape error handler by -- default, instead of the strict error handler. */ -- char *loc = setlocale(LC_CTYPE, NULL); -- if (loc != NULL && strcmp(loc, "C") == 0) -- errors = "surrogateescape"; -+ /* Choose the default error handler based on the current locale */ -+ errors = get_default_standard_stream_error_handler(); - } - } - -diff --git a/configure b/configure -index 2915246..39e5a27 100755 ---- a/configure -+++ b/configure -@@ -834,6 +834,8 @@ with_thread - enable_ipv6 - with_doc_strings - with_pymalloc -+with_c_locale_coercion -+with_c_locale_warning - with_valgrind - with_dtrace - with_fpectl -@@ -1527,6 +1529,12 @@ Optional Packages: - deprecated; use --with(out)-threads - --with(out)-doc-strings disable/enable documentation strings - --with(out)-pymalloc disable/enable specialized mallocs -+ --with(out)-c-locale-coercion -+ disable/enable C locale coercion to a UTF-8 based -+ locale -+ --with(out)-c-locale-warning -+ disable/enable locale compatibility warning in the C -+ locale - --with-valgrind Enable Valgrind support - --with(out)-dtrace disable/enable DTrace support - --with-fpectl enable SIGFPE catching -@@ -11010,6 +11018,52 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 - $as_echo "$with_pymalloc" >&6; } - -+# Check for --with-c-locale-coercion -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 -+$as_echo_n "checking for --with-c-locale-coercion... " >&6; } -+ -+# Check whether --with-c-locale-coercion was given. -+if test "${with_c_locale_coercion+set}" = set; then : -+ withval=$with_c_locale_coercion; -+fi -+ -+ -+if test -z "$with_c_locale_coercion" -+then -+ with_c_locale_coercion="yes" -+fi -+if test "$with_c_locale_coercion" != "no" -+then -+ -+$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 -+$as_echo "$with_c_locale_coercion" >&6; } -+ -+# Check for --with-c-locale-warning -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-warning" >&5 -+$as_echo_n "checking for --with-c-locale-warning... " >&6; } -+ -+# Check whether --with-c-locale-warning was given. -+if test "${with_c_locale_warning+set}" = set; then : -+ withval=$with_c_locale_warning; -+fi -+ -+ -+if test -z "$with_c_locale_warning" -+then -+ with_c_locale_warning="yes" -+fi -+if test "$with_c_locale_warning" != "no" -+then -+ -+$as_echo "#define PY_WARN_ON_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_warning" >&5 -+$as_echo "$with_c_locale_warning" >&6; } -+ - # Check for Valgrind support - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 - $as_echo_n "checking for --with-valgrind... " >&6; } -diff --git a/configure.ac b/configure.ac -index 67dfba3..b9c9f04 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3279,6 +3279,40 @@ then - fi - AC_MSG_RESULT($with_pymalloc) - -+# Check for --with-c-locale-coercion -+AC_MSG_CHECKING(for --with-c-locale-coercion) -+AC_ARG_WITH(c-locale-coercion, -+ AS_HELP_STRING([--with(out)-c-locale-coercion], -+ [disable/enable C locale coercion to a UTF-8 based locale])) -+ -+if test -z "$with_c_locale_coercion" -+then -+ with_c_locale_coercion="yes" -+fi -+if test "$with_c_locale_coercion" != "no" -+then -+ AC_DEFINE(PY_COERCE_C_LOCALE, 1, -+ [Define if you want to coerce the C locale to a UTF-8 based locale]) -+fi -+AC_MSG_RESULT($with_c_locale_coercion) -+ -+# Check for --with-c-locale-warning -+AC_MSG_CHECKING(for --with-c-locale-warning) -+AC_ARG_WITH(c-locale-warning, -+ AS_HELP_STRING([--with(out)-c-locale-warning], -+ [disable/enable locale compatibility warning in the C locale])) -+ -+if test -z "$with_c_locale_warning" -+then -+ with_c_locale_warning="yes" -+fi -+if test "$with_c_locale_warning" != "no" -+then -+ AC_DEFINE(PY_WARN_ON_C_LOCALE, 1, -+ [Define to emit a locale compatibility warning in the C locale]) -+fi -+AC_MSG_RESULT($with_c_locale_warning) -+ - # Check for Valgrind support - AC_MSG_CHECKING([for --with-valgrind]) - AC_ARG_WITH([valgrind], -diff --git a/pyconfig.h.in b/pyconfig.h.in -index b10c57f..0a6f3e2 100644 ---- a/pyconfig.h.in -+++ b/pyconfig.h.in -@@ -1244,9 +1244,15 @@ - /* Define as the preferred size in bits of long digits */ - #undef PYLONG_BITS_IN_DIGIT - -+/* Define if you want to coerce the C locale to a UTF-8 based locale */ -+#undef PY_COERCE_C_LOCALE -+ - /* Define to printf format modifier for Py_ssize_t */ - #undef PY_FORMAT_SIZE_T - -+/* Define to emit a locale compatibility warning in the C locale */ -+#undef PY_WARN_ON_C_LOCALE -+ - /* Define if you want to build an interpreter with many run-time checks. */ - #undef Py_DEBUG - diff --git a/00277-fix-test-subprocess-hanging-tests.patch b/00277-fix-test-subprocess-hanging-tests.patch deleted file mode 100644 index c9b54e2..0000000 --- a/00277-fix-test-subprocess-hanging-tests.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 54849962eacc38f4e6c6f8a72ae258b3e7c2ecd5 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Thu, 5 Oct 2017 15:05:30 +0200 -Subject: [PATCH] bpo-31178: Mock os.waitpid() in test_subprocess - -Fix test_exception_errpipe_bad_data() and -test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() -to avoid calling the real os.waitpid(0, 0) which is an unexpected -side effect of the test. ---- - Lib/test/test_subprocess.py | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py -index 00dc37bc2c7..3ba5c028517 100644 ---- a/Lib/test/test_subprocess.py -+++ b/Lib/test/test_subprocess.py -@@ -1559,8 +1559,10 @@ def proper_error(*args): - - fork_exec.side_effect = proper_error - -- with self.assertRaises(IsADirectoryError): -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(IsADirectoryError): -+ self.PopenNoDestructor(["non_existent_command"]) - - @mock.patch("subprocess._posixsubprocess.fork_exec") - def test_exception_errpipe_bad_data(self, fork_exec): -@@ -1577,8 +1579,10 @@ def bad_error(*args): - - fork_exec.side_effect = bad_error - -- with self.assertRaises(subprocess.SubprocessError) as e: -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(subprocess.SubprocessError) as e: -+ self.PopenNoDestructor(["non_existent_command"]) - - self.assertIn(repr(error_data), str(e.exception)) - diff --git a/00279-fix-memory-corruption-due-to-allocator-mix.patch b/00279-fix-memory-corruption-due-to-allocator-mix.patch deleted file mode 100644 index 4937391..0000000 --- a/00279-fix-memory-corruption-due-to-allocator-mix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/getpath.c b/Modules/getpath.c -index c4055be..1258fcd 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -735,7 +735,7 @@ calculate_path(void) - bufsz += wcslen(zip_path) + 1; - bufsz += wcslen(exec_prefix) + 1; - -- buf = PyMem_New(wchar_t, bufsz); -+ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); - if (buf == NULL) { - Py_FatalError( - "Not enough memory for dynamic PYTHONPATH"); diff --git a/macros.pybytecompile3.6 b/macros.pybytecompile3.7 similarity index 100% rename from macros.pybytecompile3.6 rename to macros.pybytecompile3.7 diff --git a/python3.spec b/python3.spec index 9b8f122..e540456 100644 --- a/python3.spec +++ b/python3.spec @@ -6,15 +6,18 @@ Name: python3 Summary: Interpreter of the Python programming language URL: https://www.python.org/ -%global pybasever 3.6 +%global pybasever 3.7 # pybasever without the dot: -%global pyshortver 36 +%global pyshortver 37 + +# Second alpha +%global prerel a2 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -Version: %{pybasever}.3 -Release: 4%{?dist} +Version: %{pybasever}.0 +Release: 0.1.%{?prerel}%{?dist} License: Python @@ -183,6 +186,7 @@ BuildRequires: gmp-devel BuildRequires: libappstream-glib BuildRequires: libffi-devel BuildRequires: libGL-devel +BuildRequires: libuuid-devel BuildRequires: libX11-devel BuildRequires: ncurses-devel @@ -225,7 +229,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz +Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -354,13 +358,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.patch -# 00262 # -# Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale -# https://www.python.org/dev/peps/pep-0538/ -# Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale -# Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 -Patch262: 00262-pep538_coerce_legacy_c_locale.patch - # 00264 # # test_pass_by_value was added in Python 3.6.1 and on aarch64 # it is catching an error that was there, but wasn't tested before. @@ -377,18 +374,6 @@ Patch273: 00273-skip-float-test.patch # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch -# 00277 # -# Fix test_exception_errpipe_bad_data() and -# test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() -# to avoid calling the real os.waitpid(0, 0) which is an unexpected -# side effect of the test, which makes the koji builds hang. -# Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 -Patch277: 00277-fix-test-subprocess-hanging-tests.patch - -# 00279 # -# Fix memory corruption due to allocator mix -# Fixed upstream: https://bugs.python.org/issue31532 -Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch # (New patches go here ^^^) # @@ -619,7 +604,6 @@ cp -a %{SOURCE7} . # Remove bundled libraries to ensure that we're using the system copy. rm -r Modules/expat -rm -r Modules/zlib %if %{with rewheel} %global pip_version 9.0.1 @@ -652,7 +636,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch251 -p1 -%patch262 -p1 %ifarch aarch64 %patch264 -p1 @@ -660,8 +643,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 -%patch277 -p1 -%patch279 -p1 # Remove files that should be generated by the build @@ -1266,6 +1247,7 @@ fi #%{dynload_dir}/time.%{SOABI_optimized}.so %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so %{dynload_dir}/unicodedata.%{SOABI_optimized}.so +%{dynload_dir}/_uuid.%{SOABI_optimized}.so %{dynload_dir}/xxlimited.%{SOABI_optimized}.so %{dynload_dir}/zlib.%{SOABI_optimized}.so @@ -1416,6 +1398,7 @@ fi %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so +%{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests %{pylibdir}/tkinter/test %{pylibdir}/unittest/test @@ -1502,6 +1485,8 @@ fi #%{dynload_dir}/time.%{SOABI_debug}.so %{dynload_dir}/_testmultiphase.%{SOABI_debug}.so %{dynload_dir}/unicodedata.%{SOABI_debug}.so +%{dynload_dir}/_uuid.%{SOABI_debug}.so +%{dynload_dir}/_xxtestfuzz.%{SOABI_debug}.so %{dynload_dir}/zlib.%{SOABI_debug}.so # No need to split things out the "Makefile" and the config-32/64.h file as we @@ -1560,6 +1545,10 @@ fi # ====================================================== %changelog +* Tue Nov 28 2017 Miro Hrončok - 3.7.0-0.1.a2 +- Update to 3.7.0 alpha 2 +- Removed merged patches 262, 277, 279 + * Tue Nov 21 2017 Miro Hrončok - 3.6.3-4 - Raise the release of platform-python obsoletes for better maintainability From 63459d7d2a4a8df39f900d753cf742c979b480a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 30 Nov 2017 09:54:54 +0100 Subject: [PATCH 02/67] Add flatpackage conditional for python37 --- python3.spec | 165 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 146 insertions(+), 19 deletions(-) diff --git a/python3.spec b/python3.spec index e540456..ea90da0 100644 --- a/python3.spec +++ b/python3.spec @@ -2,15 +2,16 @@ # Top-level metadata # ================== -Name: python3 -Summary: Interpreter of the Python programming language -URL: https://www.python.org/ - %global pybasever 3.7 # pybasever without the dot: %global pyshortver 37 +Name: python%{pyshortver} +Summary: Version %{pybasever} of the Python interpreter +URL: https://www.python.org/ + + # Second alpha %global prerel a2 @@ -28,6 +29,15 @@ License: Python # Note that the bcond macros are named for the CLI option they create. # "%%bcond_without" means "ENABLE by default and create a --without option" + +# Flat package, i.e. python36, python37, python38 for tox etc. +# warning: changes some other defaults +# in Fedora, never turn this on for the python3 package +# and always keep it on for python37 etc. +# WARNING: This does not change the package name and summary above +%bcond_without flatpackage + + # Expensive optimizations (mainly, profile-guided optimizations) %ifarch %{ix86} x86_64 %bcond_without optimizations @@ -41,11 +51,19 @@ License: Python %bcond_without tests # Ability to reuse RPM-installed pip using rewheel +%if %{with flatpackage} +%bcond_with rewheel +%else %bcond_without rewheel +%endif # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) +%if %{with flatpackage} +%bcond_with debug_build +%else %bcond_without debug_build +%endif # Support for the GDB debugger %bcond_without gdb_hooks @@ -389,6 +407,8 @@ Patch274: 00274-fix-arch-names.patch # Descriptions, and metadata for subpackages # ========================================== +%if %{without flatpackage} + # Packages with Python modules in standard locations automatically # depend on python(abi). Provide that here. Provides: python(abi) = %{pybasever} @@ -402,7 +422,7 @@ Obsoletes: system-python < %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} # In order to support multiple Python interpreters for development purposes, -# packages with with the naming scheme pythonXY (e.g. python35) exist for +# packages with with the naming scheme flatpackage (e.g. python35) exist for # non-default versions of Python 3. # For consistency, and to keep the upgrade path clean, we Provide/Obsolete # these names here. @@ -588,6 +608,27 @@ Compiled extension modules use a special ABI flag ("d") in the filename, so extensions for both verisons can co-exist in the same directory. %endif # with debug_build +%else # with flatpackage + +Requires: redhat-rpm-config + +# We'll not provide this, on purpose +# No package in Fedora shall ever depend on flatpackage via this +%global __requires_exclude ^python\\(abi\\) = 3\\..$ +%global __provides_exclude ^python\\(abi\\) = 3\\..$ + +# We keep those inside on purpose +Provides: bundled(python3-pip) = 9.0.1 +Provides: bundled(python3-setuptools) = 28.8.0 + +# The descripton for the flat flatpackage package +%description +This package exists to allow developers to test their code against an newer +version of Python. This is not a full Python stack and if you wish to run +your applications with Python %{pybasever}, update your Fedora to a newer +version once Python %{pybasever} is stable. + +%endif # with flatpackage # ====================================================== # The prep phase of the build: @@ -879,6 +920,7 @@ install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ %endif +%if %{without flatpackage} # add idle3 to menu install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png @@ -889,6 +931,7 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} mkdir -p %{buildroot}%{_datadir}/appdata cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml +%endif # Development tools install -m755 -d %{buildroot}%{pylibdir}/Tools @@ -973,12 +1016,14 @@ find %{buildroot} -perm 555 -exec chmod 755 {} \; # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ +%if %{without flatpackage} install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ +%endif # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 -%if %{with debug_build} +%if %{with debug_build} && %{without flatpackage} ln -s \ %{_bindir}/python%{LDVERSION_debug} \ %{buildroot}%{_bindir}/python3-debug @@ -986,8 +1031,10 @@ ln -s \ # System Python: Link the executable to libexec # This is for backwards compatibility only and should be removed in Fedora 29 +%if %{without flatpackage} mkdir -p %{buildroot}%{_libexecdir} ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python +%endif # ====================================================== @@ -1025,6 +1072,21 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +%if %{with flatpackage} +# Remove stuff that would conflict with python3 package +mv %{buildroot}%{_bindir}/python{3,%{pyshortver}} +rm %{buildroot}%{_bindir}/pydoc3 +rm %{buildroot}%{_bindir}/pathfix.py +rm %{buildroot}%{_bindir}/idle3 +rm %{buildroot}%{_bindir}/python3-* +rm %{buildroot}%{_bindir}/pyvenv +rm %{buildroot}%{_bindir}/2to3 +rm %{buildroot}%{_libdir}/libpython3.so +rm %{buildroot}%{_mandir}/man1/python3.1* +rm %{buildroot}%{_libdir}/pkgconfig/python3.pc +%endif + + # ====================================================== # Running the upstream test suite # ====================================================== @@ -1087,46 +1149,71 @@ CheckPython optimized # Scriptlets # ====================================================== +%if %{without flatpackage} + %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%endif + + %post +%if %{with flatpackage} +/sbin/ldconfig +%else /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +%endif %postun +%if %{with flatpackage} +/sbin/ldconfig +%else if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi - -%posttrans -/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +%endif %files %defattr(-, root, root) %license LICENSE %doc README.rst + +%if %{without flatpackage} %{_bindir}/pydoc* %{_bindir}/python3 -%{_bindir}/python%{pybasever} -%{_bindir}/python%{pybasever}m %{_bindir}/pyvenv -%{_bindir}/pyvenv-%{pybasever} -%{_mandir}/*/* # Remove in Fedora 29: %{_libexecdir}/system-python +%else +%{_bindir}/pydoc%{pybasever} +%{_bindir}/python%{pyshortver} +%endif +%{_bindir}/python%{pybasever} +%{_bindir}/python%{pybasever}m +%{_bindir}/pyvenv-%{pybasever} +%{_mandir}/*/* + + +%if %{without flatpackage} %files libs %defattr(-,root,root,-) %license LICENSE %doc README.rst +%endif %dir %{pylibdir} %dir %{dynload_dir} %{pylibdir}/lib2to3 +%if %{without flatpackage} %exclude %{pylibdir}/lib2to3/tests +%endif %dir %{pylibdir}/unittest/ %dir %{pylibdir}/unittest/__pycache__/ @@ -1151,7 +1238,13 @@ fi %dir %{pylibdir}/ensurepip/__pycache__/ %{pylibdir}/ensurepip/*.py %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} + +%if %{without flatpackage} %exclude %{pylibdir}/ensurepip/_bundled +%else +%dir %{pylibdir}/ensurepip/_bundled +%{pylibdir}/ensurepip/_bundled/*.whl +%endif %if %{with rewheel} %dir %{pylibdir}/ensurepip/rewheel/ @@ -1314,8 +1407,10 @@ fi %{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} +%if %{without flatpackage} %exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} +%endif %{pylibdir}/urllib %{pylibdir}/xml @@ -1335,7 +1430,9 @@ fi %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %{_libdir}/%{py_INSTSONAME_optimized} +%if %{without flatpackage} %{_libdir}/libpython3.so +%endif %if %{with systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} @@ -1343,42 +1440,66 @@ fi %doc systemtap-example.stp pyfuntop.stp %endif + +%if %{without flatpackage} %files devel %defattr(-,root,root) +%endif + %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* +%if %{without flatpackage} %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile +%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} +%endif %{pylibdir}/distutils/command/wininst-*.exe %{_includedir}/python%{LDVERSION_optimized}/*.h -%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit + +%if %{without flatpackage} %{_bindir}/python3-config +%{_libdir}/pkgconfig/python3.pc +%{_rpmconfigdir}/macros.d/macros.systempython +%{_bindir}/pathfix.py +%endif + %{_bindir}/python%{pybasever}-config %{_bindir}/python%{LDVERSION_optimized}-config %{_bindir}/python%{LDVERSION_optimized}-*-config -%{_bindir}/pathfix.py %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc -%{_libdir}/pkgconfig/python3.pc %{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} -%{_rpmconfigdir}/macros.d/macros.systempython + +%if %{without flatpackage} %files tools %defattr(-,root,root,755) + %{_bindir}/2to3 +%{_bindir}/idle* +%else +%{_bindir}/idle%{pybasever} +%endif + # TODO: Remove 2to3-3.7 once rebased to 3.7 %{_bindir}/2to3-%{pybasever} -%{_bindir}/idle* %{pylibdir}/Tools %doc %{pylibdir}/Doc +%if %{without flatpackage} %{_datadir}/appdata/idle3.appdata.xml %{_datadir}/applications/idle3.desktop %{_datadir}/icons/hicolor/*/apps/idle3.* +%endif +%if %{without flatpackage} %files tkinter %defattr(-,root,root,755) +%endif + %{pylibdir}/tkinter +%if %{without flatpackage} %exclude %{pylibdir}/tkinter/test +%endif %{dynload_dir}/_tkinter.%{SOABI_optimized}.so %{pylibdir}/turtle.py %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} @@ -1388,8 +1509,12 @@ fi %dir %{pylibdir}/turtledemo/__pycache__/ %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} + +%if %{without flatpackage} %files test %defattr(-, root, root) +%endif + %{pylibdir}/ctypes/test %{pylibdir}/distutils/tests %{pylibdir}/sqlite3/test @@ -1411,12 +1536,14 @@ fi # all of the other subpackages %if %{with debug_build} +%if %{without flatpackage} %files debug %defattr(-,root,root,-) +%{_bindir}/python3-debug +%endif # Analog of the core subpackage's files: %{_bindir}/python%{LDVERSION_debug} -%{_bindir}/python3-debug # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: From 08796195b5a2a3f3d957c607783948d306985278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 30 Nov 2017 16:47:53 +0100 Subject: [PATCH 03/67] Remove /usr/bin/2to3-3.7 --- python3.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index ea90da0..be00616 100644 --- a/python3.spec +++ b/python3.spec @@ -1072,6 +1072,10 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +# There's no point of having this, as decided in +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +rm %{buildroot}%{_bindir}/2to3-%{pybasever} + %if %{with flatpackage} # Remove stuff that would conflict with python3 package mv %{buildroot}%{_bindir}/python{3,%{pyshortver}} @@ -1481,8 +1485,6 @@ fi %{_bindir}/idle%{pybasever} %endif -# TODO: Remove 2to3-3.7 once rebased to 3.7 -%{_bindir}/2to3-%{pybasever} %{pylibdir}/Tools %doc %{pylibdir}/Doc %if %{without flatpackage} From 33e1cb6f54bad46d939e760c9654d9c9b0944c70 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Fri, 1 Dec 2017 12:28:37 +0000 Subject: [PATCH 04/67] Added the README --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..42bf07d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# python37 + +The python37 package \ No newline at end of file From 1da74de71e201c9109a4f256862d6cf863f7170a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Dec 2017 13:52:53 +0100 Subject: [PATCH 05/67] Rename the specfile to fit package name --- python3.spec => python37.spec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python3.spec => python37.spec (100%) diff --git a/python3.spec b/python37.spec similarity index 100% rename from python3.spec rename to python37.spec From c93495efdf6816cb23deca82b36df13e6a83a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Dec 2017 13:53:36 +0100 Subject: [PATCH 06/67] Purge %changelog --- python37.spec | 1026 ------------------------------------------------- 1 file changed, 1026 deletions(-) diff --git a/python37.spec b/python37.spec index be00616..57a4691 100644 --- a/python37.spec +++ b/python37.spec @@ -1677,1029 +1677,3 @@ fi * Tue Nov 28 2017 Miro Hrončok - 3.7.0-0.1.a2 - Update to 3.7.0 alpha 2 - Removed merged patches 262, 277, 279 - -* Tue Nov 21 2017 Miro Hrončok - 3.6.3-4 -- Raise the release of platform-python obsoletes for better maintainability - -* Wed Nov 15 2017 Miro Hrončok - 3.6.3-3 -- Obsolete platform-python and it's subpackages - -* Mon Oct 09 2017 Charalampos Stratakis - 3.6.3-2 -- Fix memory corruption due to allocator mix -Resolves: rhbz#1498207 - -* Fri Oct 06 2017 Charalampos Stratakis - 3.6.3-1 -- Update to Python 3.6.3 - -* Fri Sep 29 2017 Miro Hrončok - 3.6.2-19 -- Move pathfix.py to bindir, https://github.com/fedora-python/python-rpm-porting/issues/24 -- Make the -devel package require redhat-rpm-config -Resolves: rhbz#1496757 - -* Wed Sep 13 2017 Iryna Shcherbina - 3.6.2-18 -- Fix /usr/bin/env dependency from python3-tools -Resolves: rhbz#1482118 - -* Wed Sep 06 2017 Iryna Shcherbina - 3.6.2-17 -- Include `-g` in the flags sent to the linker (LDFLAGS) -Resolves: rhbz#1483222 - -* Tue Sep 05 2017 Petr Viktorin - 3.6.2-16 -- Specfile cleanup -- Make the main description also applicable to the SRPM -- Add audiotest.au to the test package - -* Fri Sep 01 2017 Miro Hrončok - 3.6.2-15 -- Remove %%{pylibdir}/Tools/scripts/2to3 - -* Fri Sep 01 2017 Miro Hrončok - 3.6.2-14 -- Expat >= 2.1.0 is everywhere, remove explicit requires -- Conditionalize systemtap-devel BuildRequires -- For consistency, require /usr/sbin/ifconfig instead of net-tools - -* Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 -- Rename patch files to be consistent -- Run autotools to generate the configure script before building -- Merge lib64 patches (104 into 102) -- Skip test_bdist_rpm using test config rather than a patch (removes patch 137) -- Remove patches 157 and 186, which had test changes left over after upstreaming -- Remove patch 188, a temporary workaround for hashlib tests -- Merge patches 180, 206, 243, 5001 (architecture naming) into new patch 274 -- Move python2-tools conflicts to tools subpackage (it was wrongly in tkinter) - -* Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 -- Use python3 style of calling super() without arguments in rpath - patch to prevent recursion in UnixCCompiler subclasses -Resolves: rhbz#1458122 - -* Mon Aug 21 2017 Petr Viktorin - 3.6.2-11 -- Add bcond for --without optimizations -- Reword package descriptions -- Remove Group declarations -- Skip failing test_float_with_comma - -* Mon Aug 21 2017 Miro Hrončok - 3.6.2-10 -- Remove system-python, see https://fedoraproject.org/wiki/Changes/Platform_Python_Stack - -* Wed Aug 16 2017 Petr Viktorin - 3.6.2-9 -- Use bconds for configuring the build -- Reorganize the initial sections - -* Wed Aug 16 2017 Miro Hrončok - 3.6.2-8 -- Have /usr/bin/2to3 (rhbz#1111275) -- Provide 2to3 and idle3, list them in summary and description (rhbz#1076401) - -* Fri Aug 11 2017 Michal Cyprian - 3.6.2-7 -- Revert "Add --executable option to install.py command" - This enhancement is currently not needed and it can possibly - collide with `pip --editable`option - -* Mon Aug 07 2017 Iryna Shcherbina - 3.6.2-6 -- Fix the "urllib FTP protocol stream injection" vulnerability -Resolves: rhbz#1478916 - -* Tue Aug 01 2017 Tomas Orsava - 3.6.2-5 -- Dropped BuildRequires on db4-devel which was useful for Python 2 (module - bsddb), however, no longer needod for Python 3 -- Tested building Python 3 with and without the dependency, all tests pass and - filelists of resulting RPMs are identical - -* Sun Jul 30 2017 Florian Weimer - 3.6.2-4 -- Do not generate debuginfo subpackages (#1476593) -- Rebuild with binutils fix for ppc64le (#1475636) - -* Thu Jul 27 2017 Fedora Release Engineering - 3.6.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Tue Jul 25 2017 Charalampos Stratakis - 3.6.2-2 -- Make test_asyncio to not depend on the current SIGHUP signal handler. - -* Tue Jul 18 2017 Charalampos Stratakis - 3.6.2-1 -- Update to Python 3.6.2 - -* Tue Jun 27 2017 Charalampos Stratakis - 3.6.1-10 -- Update to the latest upstream implementation of PEP 538 - -* Mon Jun 26 2017 Michal Cyprian - 3.6.1-9 -- Make pip and distutils in user environment install into separate location - -* Fri Jun 23 2017 Charalampos Stratakis - 3.6.1-8 -- Fix test_alpn_protocols from test_ssl -- Do not require rebundled setuptools dependencies - -* Tue May 16 2017 Tomas Orsava - 3.6.1-7 -- Added a dependency to the devel subpackage on python3-rpm-generators which - have been excised out of rpm-build -- Updated notes on bootstrapping Python on top of this specfile accordingly -- Involves: rhbz#1410631, rhbz#1444925 - -* Tue May 09 2017 Charalampos Stratakis - 3.6.1-6 -- Enable profile guided optimizations for x86_64 and i686 architectures -- Update to a newer implementation of PEP 538 -- Update description to reflect that Python 3 is now the default Python - -* Fri May 05 2017 Charalampos Stratakis - 3.6.1-5 -- Update PEP 538 to the latest upstream implementation - -* Tue Apr 18 2017 Charalampos Stratakis - 3.6.1-4 -- Enable link time optimizations -- Move windows executables to the devel subpackage (rhbz#1426257) - -* Thu Apr 13 2017 Tomas Orsava - 3.6.1-3 -- Rename python3.Xdm-config script from -debug to be arch specific -Resolves: rhbz#1179073 - -* Wed Apr 05 2017 Charalampos Stratakis - 3.6.1-2 -- Install the Makefile in its proper location (rhbz#1438219) - -* Wed Mar 22 2017 Iryna Shcherbina - 3.6.1-1 -- Update to version 3.6.1 final - -* Tue Mar 21 2017 Tomas Orsava - 3.6.1-0.2.rc1 -- Fix syntax error in %%py_byte_compile macro (rhbz#1433569) - -* Thu Mar 16 2017 Iryna Shcherbina - 3.6.1-0.1.rc1 -- Update to Python 3.6.1 release candidate 1 -- Add patch 264 to skip a known test failure on aarch64 - -* Fri Mar 10 2017 Charalampos Stratakis - 3.6.0-21 -- Use proper command line parsing in _testembed -- Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale - https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale - -* Mon Feb 27 2017 Charalampos Stratakis - 3.6.0-20 -- Add desktop entry and appdata.xml file for IDLE 3 (rhbz#1392049) - -* Fri Feb 24 2017 Michal Cyprian - 3.6.0-19 -- Revert "Set values of prefix and exec_prefix to /usr/local for - /usr/bin/python* executables..." to prevent build failures - of packages using alternate build tools - -* Tue Feb 21 2017 Michal Cyprian - 3.6.0-18 -- Set values of prefix and exec_prefix to /usr/local for - /usr/bin/python* executables -- Use new %%_module_build macro - -* Fri Feb 17 2017 Michal Cyprian - 3.6.0-13 -- Add --executable option to install.py command - -* Wed Feb 15 2017 Charalampos Stratakis - 3.6.0-12 -- BuildRequire the new dependencies of setuptools when rewheel mode is enabled -in order for the virtualenvs to work properly - -* Sat Feb 11 2017 Fedora Release Engineering - 3.6.0-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Wed Feb 01 2017 Stephen Gallagher - 3.6.0-10 -- Add missing %%license macro - -* Thu Jan 26 2017 Tomas Orsava - 3.6.0-9 -- Modify the runtime dependency of python3-libs on system-python-libs again, - because previous attempt didn't work properly with dnf resolving mechanism - -* Wed Jan 25 2017 Tomas Orsava - 3.6.0-8 -- Modify the runtime dependency of python3-libs on system-python-libs to use - just the version and release number, but not the dist tag due to Modularity - -* Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 -- Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) -- Skip test_aead_aes_gcm during rpmbuild - -* Thu Jan 12 2017 Igor Gnatenko - 3.6.0-6 -- Rebuild for readline 7.x - -* Tue Jan 10 2017 Charalampos Stratakis - 3.6.0-5 -- Require glibc >= 2.24.90-26 for system-python-libs (rhbz#1410644) - -* Mon Jan 09 2017 Charalampos Stratakis - 3.6.0-4 -- Define HAVE_LONG_LONG as 1 for backwards compatibility - -* Thu Jan 05 2017 Miro Hrončok - 3.6.0-3 -- Don't blow up on EL7 kernel (random generator) (rhbz#1410175) - -* Tue Dec 27 2016 Charalampos Stratakis - 3.6.0-1 -- Update to Python 3.6.0 final - -* Fri Dec 09 2016 Charalampos Stratakis - 3.6.0-0.6.rc1 -- Enable rewheel - -* Wed Dec 07 2016 Charalampos Stratakis - 3.6.0-0.5.rc1 -- Update to Python 3.6.0 release candidate 1 - -* Mon Dec 05 2016 Charalampos Stratakis - 3.6.0-0.4.b4 -- Update to Python 3.6.0 beta 4 - -* Mon Dec 05 2016 Charalampos Stratakis - 3.5.2-7 -- Set to work with pip version 9.0.1 - -* Wed Oct 12 2016 Charalampos Stratakis - 3.5.2-6 -- Use proper patch numbering and base upstream branch for -porting ssl and hashlib modules to OpenSSL 1.1.0 -- Drop hashlib patch for now -- Add riscv64 arch to 64bit and no-valgrind arches - -* Tue Oct 11 2016 Tomáš Mráz - 3.5.2-5 -- Make it build with OpenSSL-1.1.0 based on upstream patch - -* Wed Sep 14 2016 Charalampos Stratakis - 3.5.2-4 -- Obsolete and Provide python35 package - -* Mon Sep 12 2016 Charalampos Stratakis - 3.5.2-3 -- Update %py_byte_compile macro -- Remove unused configure flags (rhbz#1374357) - -* Fri Sep 09 2016 Tomas Orsava - 3.5.2-2 -- Updated .pyc 'bytecompilation with the newly installed interpreter' to also - recompile optimized .pyc files -- Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo - files are no more -- Resolves rhbz#1373635 - -* Mon Aug 15 2016 Tomas Orsava - 3.5.2-1 -- Rebased to version 3.5.2 -- Set to work with pip version 8.1.2 -- Removed patches 207, 237, 241 as fixes are already contained in Python 3.5.2 -- Removed arch or environment specific patches 194, 196, 203, and 208 - as test builds indicate they are no longer needed -- Updated patches 102, 146, and 242 to work with the new Python codebase -- Removed patches 200, 201, 5000 which weren't even being applied - -* Tue Aug 09 2016 Charalampos Stratakis - 3.5.1-15 -- Fix for CVE-2016-1000110 HTTPoxy attack -- SPEC file cleanup - -* Mon Aug 01 2016 Michal Toman - 3.5.1-14 -- Build properly on MIPS - -* Tue Jul 19 2016 Fedora Release Engineering - 3.5.1-13 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-12 -- Refactor patch for properly fixing CVE-2016-5636 - -* Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-11 -- Fix test_pyexpat failure with Expat version of 2.2.0 - -* Fri Jul 08 2016 Miro Hrončok - 3.5.1-10 -- Move xml module to system-python-libs - -* Thu Jun 16 2016 Tomas Orsava - 3.5.1-9 -- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack -- Raise an error when STARTTLS fails -- rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647 -- rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 -- Fixed upstream: https://hg.python.org/cpython/rev/d590114c2394 - -* Mon Jun 13 2016 Charalampos Stratakis - 3.5.1-8 -- Added patch for fixing possible integer overflow and heap corruption in zipimporter.get_data() - -* Fri Mar 04 2016 Miro Hrončok - 3.5.1-7 -- Move distutils to system-python-libs - -* Wed Feb 24 2016 Robert Kuska - 3.5.1-6 -- Provide python3-enum34 - -* Fri Feb 19 2016 Miro Hrončok - 3.5.1-5 -- Provide System Python packages and macros - -* Thu Feb 04 2016 Fedora Release Engineering - 3.5.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Wed Jan 13 2016 Orion Poplwski - 3.5.1-2 -- Drop python3 macros, require python/python3-rpm-macros - -* Mon Dec 14 2015 Robert Kuska - 3.5.1-1 -- Update to 3.5.1 -- Removed patch 199 and 207 (upstream) - -* Sun Nov 15 2015 Robert Kuska - 3.5.0-5 -- Remove versioned libpython from devel package - -* Fri Nov 13 2015 Than Ngo 3.5.0-4 -- add correct arch for ppc64/ppc64le to fix build failure - -* Wed Nov 11 2015 Robert Kuska - 3.5.0-3 -- Hide the private _Py_atomic_xxx symbols from public header - -* Wed Oct 14 2015 Robert Kuska - 3.5.0-2 -- Rebuild with wheel set to 1 - -* Tue Sep 15 2015 Matej Stuchlik - 3.5.0-1 -- Update to 3.5.0 - -* Mon Jun 29 2015 Thomas Spura - 3.4.3-4 -- python3-devel: Require python-macros for version independant macros such as - python_provide. See fpc#281 and fpc#534. - -* Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Wed Jun 17 2015 Matej Stuchlik - 3.4.3-4 -- Use 1024bit DH key in test_ssl -- Use -O0 when compiling -debug build -- Update pip version variable to the version we actually ship - -* Wed Jun 17 2015 Matej Stuchlik - 3.4.3-3 -- Make relocating Python by changing _prefix actually work -Resolves: rhbz#1231801 - -* Mon May 4 2015 Peter Robinson 3.4.3-2 -- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches - -* Thu Mar 12 2015 Matej Stuchlik - 3.4.3-1 -- Updated to 3.4.3 -- BuildPython now accepts additional build options -- Temporarily disabled test_gdb on arm (rhbz#1196181) - -* Wed Feb 25 2015 Matej Stuchlik - 3.4.2-7 -- Fixed undefined behaviour in faulthandler which caused test to hang on x86_64 - (http://bugs.python.org/issue23433) - -* Sat Feb 21 2015 Till Maas - 3.4.2-6 -- Rebuilt for Fedora 23 Change - https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code - -* Tue Feb 17 2015 Ville Skyttä - 3.4.2-5 -- Own systemtap dirs (#710733) - -* Mon Jan 12 2015 Dan Horák - 3.4.2-4 -- build with valgrind on ppc64le -- disable test_gdb on s390(x) until rhbz#1181034 is resolved - -* Tue Dec 16 2014 Robert Kuska - 3.4.2-3 -- New patches: 170 (gc asserts), 200 (gettext headers), - 201 (gdbm memory leak) - -* Thu Dec 11 2014 Robert Kuska - 3.4.2-2 -- OpenSSL disabled SSLv3 in SSLv23 method - -* Thu Nov 13 2014 Matej Stuchlik - 3.4.2-1 -- Update to 3.4.2 -- Refreshed patches: 156 (gdb autoload) -- Removed: 195 (Werror declaration), 197 (CVE-2014-4650) - -* Mon Nov 03 2014 Slavek Kabrda - 3.4.1-16 -- Fix CVE-2014-4650 - CGIHTTPServer URL handling -Resolves: rhbz#1113529 - -* Sun Sep 07 2014 Karsten Hopp 3.4.1-15 -- exclude test_gdb on ppc* (rhbz#1132488) - -* Thu Aug 21 2014 Slavek Kabrda - 3.4.1-14 -- Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1 - -* Sun Aug 17 2014 Fedora Release Engineering - 3.4.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sun Jun 8 2014 Peter Robinson 3.4.1-12 -- aarch64 has valgrind, just list those that don't support it - -* Sun Jun 08 2014 Fedora Release Engineering - 3.4.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Wed Jun 04 2014 Karsten Hopp 3.4.1-10 -- bump release and rebuild to link with the correct tcl/tk libs on ppcle - -* Tue Jun 03 2014 Matej Stuchlik - 3.4.1-9 -- Change paths to bundled projects in rewheel patch - -* Fri May 30 2014 Miro Hrončok - 3.4.1-8 -- In config script, use uname -m to write the arch - -* Thu May 29 2014 Dan Horák - 3.4.1-7 -- update the arch list where valgrind exists - %%power64 includes also - ppc64le which is not supported yet - -* Thu May 29 2014 Miro Hrončok - 3.4.1-6 -- Forward arguments to the arch specific config script -Resolves: rhbz#1102683 - -* Wed May 28 2014 Miro Hrončok - 3.4.1-5 -- Rename python3.Xm-config script to arch specific. -Resolves: rhbz#1091815 - -* Tue May 27 2014 Bohuslav Kabrda - 3.4.1-4 -- Use python3-*, not python-* runtime requires on setuptools and pip -- rebuild for tcl-8.6 - -* Tue May 27 2014 Matej Stuchlik - 3.4.1-3 -- Update the rewheel module - -* Mon May 26 2014 Miro Hrončok - 3.4.1-2 -- Fix multilib dependencies. -Resolves: rhbz#1091815 - -* Sun May 25 2014 Matej Stuchlik - 3.4.1-1 -- Update to Python 3.4.1 - -* Sun May 25 2014 Matej Stuchlik - 3.4.0-8 -- Fix test_gdb failure on ppc64le -Resolves: rhbz#1095355 - -* Thu May 22 2014 Miro Hrončok - 3.4.0-7 -- Add macro %%python3_version_nodots - -* Sun May 18 2014 Matej Stuchlik - 3.4.0-6 -- Disable test_faulthandler, test_gdb on aarch64 -Resolves: rhbz#1045193 - -* Fri May 16 2014 Matej Stuchlik - 3.4.0-5 -- Don't add Werror=declaration-after-statement for extension - modules through setup.py (PyBT#21121) - -* Mon May 12 2014 Matej Stuchlik - 3.4.0-4 -- Add setuptools and pip to Requires - -* Tue Apr 29 2014 Matej Stuchlik - 3.4.0-3 -- Point __os_install_post to correct brp-* files - -* Tue Apr 15 2014 Matej Stuchlik - 3.4.0-2 -- Temporarily disable tests requiring SIGHUP (rhbz#1088233) - -* Tue Apr 15 2014 Matej Stuchlik - 3.4.0-1 -- Update to Python 3.4 final -- Add patch adding the rewheel module -- Merge patches from master - -* Wed Jan 08 2014 Bohuslav Kabrda - 3.4.0-0.1.b2 -- Update to Python 3.4 beta 2. -- Refreshed patches: 55 (systemtap), 146 (hashlib-fips), 154 (test_gdb noise) -- Dropped patches: 114 (statvfs constants), 177 (platform unicode) - -* Mon Nov 25 2013 Bohuslav Kabrda - 3.4.0-0.1.b1 -- Update to Python 3.4 beta 1. -- Refreshed patches: 102 (lib64), 111 (no static lib), 125 (less verbose COUNT -ALLOCS), 141 (fix COUNT_ALLOCS in test_module), 146 (hashlib fips), -157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port) -- Removed patch 00187 (remove pthread atfork; upstreamed) - -* Mon Nov 04 2013 Bohuslav Kabrda - 3.4.0-0.1.a4 -- Update to Python 3.4 alpha 4. -- Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib), -114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in -test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise), -157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise -from py_compile) -- Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in -Koji), 142 (the mock issue that caused this is fixed) -- Added patch 187 (remove thread atfork) - will be in next version -- Refreshed script for checking pyc and pyo timestamps with new ignored files. -- The fips patch is disabled for now until upstream makes a final decision -what to do with sha3 implementation for 3.4.0. - -* Wed Oct 30 2013 Bohuslav Kabrda - 3.3.2-7 -- Bytecompile all *.py files properly during build (rhbz#1023607) - -* Fri Aug 23 2013 Matej Stuchlik - 3.3.2-6 -- Added fix for CVE-2013-4238 (rhbz#996399) - -* Fri Jul 26 2013 Dennis Gilmore - 3.3.2-5 -- fix up indentation in arm patch - -* Fri Jul 26 2013 Dennis Gilmore - 3.3.2-4 -- disable a test that fails on arm -- enable valgrind support on arm arches - -* Tue Jul 02 2013 Bohuslav Kabrda - 3.3.2-3 -- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696). - -* Mon May 20 2013 Bohuslav Kabrda - 3.3.2-2 -- Add patch for CVE-2013-2099 (rhbz#963261). - -* Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 -- Updated to Python 3.3.2. -- Refreshed patches: 153 (gdb test noise) -- Dropped patches: 175 (configure -Wformat, fixed upstream), 182 (gdb -test threads) -- Synced patch numbers with python.spec. - -* Thu May 9 2013 David Malcolm - 3.3.1-4 -- fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) - -* Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 -- Add patch that enables building on ppc64p7 (replace the sed, so that -we get consistent with python2 spec and it's more obvious that we're doing it. - -* Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 -- Add fix for gdb tests failing on arm, rhbz#951802. - -* Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 -- Updated to Python 3.3.1. -- Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), -153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just -keeping few more downstream tests) -- Removed patches: 3 (audiotest.au made it to upstream tarball) -- Removed workaround for http://bugs.python.org/issue14774, discussed in -http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. - -* Mon Mar 25 2013 David Malcolm - 3.3.0-10 -- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates - -* Mon Mar 25 2013 David Malcolm - 3.3.0-9 -- renumber patches to keep them in sync with python.spec - -* Fri Mar 15 2013 Toshio Kuratomi - 3.3.0-8 -- Fix error in platform.platform() when non-ascii byte strings are decoded to - unicode (rhbz#922149) - -* Thu Mar 14 2013 Toshio Kuratomi - 3.3.0-7 -- Fix up shared library extension (rhbz#889784) - -* Thu Mar 07 2013 Karsten Hopp 3.3.0-6 -- add ppc64p7 build target, optimized for Power7 - -* Mon Mar 4 2013 David Malcolm - 3.3.0-5 -- add workaround for ENOPROTOOPT seen running selftests in Koji -(rhbz#913732) - -* Mon Mar 4 2013 David Malcolm - 3.3.0-4 -- remove config flag from /etc/rpm/macros.{python3|pybytecompile} - -* Mon Feb 11 2013 David Malcolm - 3.3.0-3 -- add aarch64 (rhbz#909783) - -* Thu Nov 29 2012 David Malcolm - 3.3.0-2 -- add BR on bluez-libs-devel (rhbz#879720) - -* Sat Sep 29 2012 David Malcolm - 3.3.0-1 -- 3.3.0rc3 -> 3.3.0; drop alphatag - -* Mon Sep 24 2012 David Malcolm - 3.3.0-0.6.rc3 -- 3.3.0rc2 -> 3.3.0rc3 - -* Mon Sep 10 2012 David Malcolm - 3.3.0-0.5.rc2 -- 3.3.0rc1 -> 3.3.0rc2; refresh patch 55 - -* Mon Aug 27 2012 David Malcolm - 3.3.0-0.4.rc1 -- 3.3.0b2 -> 3.3.0rc1; refresh patches 3, 55 - -* Mon Aug 13 2012 David Malcolm - 3.3.0-0.3.b2 -- 3.3b1 -> 3.3b2; drop upstreamed patch 152; refresh patches 3, 102, 111, -134, 153, 160; regenenerate autotools patch; rework systemtap patch to work -correctly when LANG=C (patch 55); importlib.test was moved to -test.test_importlib upstream - -* Mon Aug 13 2012 Karsten Hopp 3.3.0-0.2.b1 -- disable some failing checks on PPC* (rhbz#846849) - -* Fri Aug 3 2012 David Malcolm - 3.3.0-0.1.b1 -- 3.2 -> 3.3: https://fedoraproject.org/wiki/Features/Python_3.3 -- 3.3.0b1: refresh patches 3, 55, 102, 111, 113, 114, 134, 157; drop upstream -patch 147; regenenerate autotools patch; drop "--with-wide-unicode" from -configure (PEP 393); "plat-linux2" -> "plat-linux" (upstream issue 12326); -"bz2" -> "_bz2" and "crypt" -> "_crypt"; egg-info files are no longer shipped -for stdlib (upstream issues 10645 and 12218); email/test moved to -test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add -_decimal and _lzma modules; make collections modules explicit in payload again -(upstream issue 11085); add _testbuffer module to tests subpackage (added in -upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); -workaround erroneously shared _sysconfigdata.py upstream issue #14774; fix -distutils.sysconfig traceback (patch 162); add BuildRequires: xz-devel (for -_lzma module); skip some tests within test_socket (patch 163) - -* Sat Jul 21 2012 Fedora Release Engineering - 3.2.3-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Fri Jul 20 2012 David Malcolm - 3.3.0-0.1.b1 - -* Fri Jun 22 2012 David Malcolm - 3.2.3-10 -- use macro for power64 (rhbz#834653) - -* Mon Jun 18 2012 David Malcolm - 3.2.3-9 -- fix missing include in uid/gid handling patch (patch 157; rhbz#830405) - -* Wed May 30 2012 Bohuslav Kabrda - 3.2.3-8 -- fix tapset for debug build - -* Tue May 15 2012 David Malcolm - 3.2.3-7 -- update uid/gid handling to avoid int overflows seen with uid/gid -values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470) - -* Fri May 4 2012 David Malcolm - 3.2.3-6 -- renumber autotools patch from 300 to 5000 -- specfile cleanups - -* Mon Apr 30 2012 David Malcolm - 3.2.3-5 -- fix test_gdb.py (patch 156; rhbz#817072) - -* Fri Apr 20 2012 David Malcolm - 3.2.3-4 -- avoid allocating thunks in ctypes unless absolutely necessary, to avoid -generating SELinux denials on "import ctypes" and "import uuid" when embedding -Python within httpd (patch 155; rhbz#814391) - -* Fri Apr 20 2012 David Malcolm - 3.2.3-3 -- add explicit version requirements on expat to avoid linkage problems with -XML_SetHashSalt - -* Thu Apr 12 2012 David Malcolm - 3.2.3-2 -- fix test_gdb (patch 153) - -* Wed Apr 11 2012 David Malcolm - 3.2.3-1 -- 3.2.3; refresh patch 102 (lib64); drop upstream patches 148 (gdbm magic -values), 149 (__pycache__ fix); add patch 152 (test_gdb regex) - -* Thu Feb 9 2012 Thomas Spura - 3.2.2-13 -- use newly installed python for byte compiling (now for real) - -* Sun Feb 5 2012 Thomas Spura - 3.2.2-12 -- use newly installed python for byte compiling (#787498) - -* Wed Jan 4 2012 Ville Skyttä - 3.2.2-11 -- Build with $RPM_LD_FLAGS (#756863). -- Use xz-compressed source tarball. - -* Wed Dec 07 2011 Karsten Hopp 3.2.2-10 -- disable rAssertAlmostEqual in test_cmath on PPC (#750811) - -* Mon Oct 17 2011 Rex Dieter - 3.2.2-9 -- python3-devel missing autogenerated pkgconfig() provides (#746751) - -* Mon Oct 10 2011 David Malcolm - 3.2.2-8 -- cherrypick fix for distutils not using __pycache__ when byte-compiling -files (rhbz#722578) - -* Fri Sep 30 2011 David Malcolm - 3.2.2-7 -- re-enable gdbm (patch 148; rhbz#742242) - -* Fri Sep 16 2011 David Malcolm - 3.2.2-6 -- add a sys._debugmallocstats() function (patch 147) - -* Wed Sep 14 2011 David Malcolm - 3.2.2-5 -- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and -_sha* modules, relying on _hashlib in hashlib (rhbz#563986; patch 146) - -* Tue Sep 13 2011 David Malcolm - 3.2.2-4 -- disable gdbm module to prepare for gdbm soname bump - -* Mon Sep 12 2011 David Malcolm - 3.2.2-3 -- renumber and rename patches for consistency with python.spec (8 to 55, 106 -to 104, 6 to 111, 104 to 113, 105 to 114, 125, 131, 130 to 143) - -* Sat Sep 10 2011 David Malcolm - 3.2.2-2 -- rewrite of "check", introducing downstream-only hooks for skipping specific -cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more -fine-grained manner than before; (patches 106, 133-142 sparsely, moving -patches for consistency with python.spec: 128 to 134, 126 to 135, 127 to 141) - -* Tue Sep 6 2011 David Malcolm - 3.2.2-1 -- 3.2.2 - -* Thu Sep 1 2011 David Malcolm - 3.2.1-7 -- run selftests with "--verbose" -- disable parts of test_io on ppc (rhbz#732998) - -* Wed Aug 31 2011 David Malcolm - 3.2.1-6 -- use "--findleaks --verbose3" when running test suite - -* Tue Aug 23 2011 David Malcolm - 3.2.1-5 -- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit -ppc to avoid aliasing violations (patch 130; rhbz#698726) - -* Tue Aug 23 2011 David Malcolm - 3.2.1-4 -- don't use --with-tsc on ppc64 debug builds (rhbz#698726) - -* Thu Aug 18 2011 David Malcolm - 3.2.1-3 -- add %%python3_version to the rpm macros (rhbz#719082) - -* Mon Jul 11 2011 Dennis Gilmore - 3.2.1-2 -- disable some tests on sparc arches - -* Mon Jul 11 2011 David Malcolm - 3.2.1-1 -- 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling -of static library build (due to Modules/_testembed; patch 6), autotool -intermediates (patch 300) - -* Fri Jul 8 2011 David Malcolm - 3.2-5 -- use the gdb hooks from the upstream tarball, rather than keeping our own copy - -* Fri Jul 8 2011 David Malcolm - 3.2-4 -- don't run test_openpty and test_pty in %%check - -* Fri Jul 8 2011 David Malcolm - 3.2-3 -- cleanup of BuildRequires; add comment headings to specfile sections - -* Tue Apr 19 2011 David Malcolm - 3.2-2 -- fix the libpython.stp systemtap tapset (rhbz#697730) - -* Mon Feb 21 2011 David Malcolm - 3.2-1 -- 3.2 -- drop alphatag -- regenerate autotool patch - -* Mon Feb 14 2011 David Malcolm - 3.2-0.13.rc3 -- add a /usr/bin/python3-debug symlink within the debug subpackage - -* Mon Feb 14 2011 David Malcolm - 3.2-0.12.rc3 -- 3.2rc3 -- regenerate autotool patch - -* Wed Feb 09 2011 Fedora Release Engineering - 3.2-0.11.rc2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Jan 31 2011 David Malcolm - 3.2-0.10.rc2 -- 3.2rc2 - -* Mon Jan 17 2011 David Malcolm - 3.2-0.9.rc1 -- 3.2rc1 -- rework patch 6 (static lib removal) -- remove upstreamed patch 130 (ppc debug build) -- regenerate patch 300 (autotool intermediates) -- updated packaging to reflect upstream rewrite of "Demo" (issue 7962) -- added libpython3.so and 2to3-3.2 - -* Wed Jan 5 2011 David Malcolm - 3.2-0.8.b2 -- set EXTRA_CFLAGS to our CFLAGS, rather than overriding OPT, fixing a linker -error with dynamic annotations (when configured using --with-valgrind) -- fix the ppc build of the debug configuration (patch 130; rhbz#661510) - -* Tue Jan 4 2011 David Malcolm - 3.2-0.7.b2 -- add --with-valgrind to configuration (on architectures that support this) - -* Wed Dec 29 2010 David Malcolm - 3.2-0.6.b2 -- work around test_subprocess failure seen in koji (patch 129) - -* Tue Dec 28 2010 David Malcolm - 3.2-0.5.b2 -- 3.2b2 -- rework patch 3 (removal of mimeaudio tests), patch 6 (no static libs), -patch 8 (systemtap), patch 102 (lib64) -- remove patch 4 (rendered redundant by upstream r85537), patch 103 (PEP 3149), -patch 110 (upstreamed expat fix), patch 111 (parallel build fix for grammar -fixed upstream) -- regenerate patch 300 (autotool intermediates) -- workaround COUNT_ALLOCS weakref issues in test suite (patch 126, patch 127, -patch 128) -- stop using runtest.sh in %%check (dropped by upstream), replacing with -regrtest; fixup list of failing tests -- introduce "pyshortver", "SOABI_optimized" and "SOABI_debug" macros -- rework manifests of shared libraries to use "SOABI_" macros, reflecting -PEP 3149 -- drop itertools, operator and _collections modules from the manifests as py3k -commit r84058 moved these inside libpython; json/tests moved to test/json_tests -- move turtle code into the tkinter subpackage - -* Wed Nov 17 2010 David Malcolm - 3.2-0.5.a1 -- fix sysconfig to not rely on the -devel subpackage (rhbz#653058) - -* Thu Sep 9 2010 David Malcolm - 3.2-0.4.a1 -- move most of the content of the core package to the libs subpackage, given -that the libs aren't meaningfully usable without the standard libraries - -* Wed Sep 8 2010 David Malcolm - 3.2-0.3.a1 -- Move test.support to core package (rhbz#596258) -- Add various missing __pycache__ directories to payload - -* Sun Aug 22 2010 Toshio Kuratomi - 3.2-0.2.a1 -- Add __pycache__ directory for site-packages - -* Sun Aug 22 2010 Thomas Spura - 3.2-0.1.a1 -- on 64bit "stdlib" was still "/usr/lib/python*" (modify *lib64.patch) -- make find-provides-without-python-sonames.sh 64bit aware - -* Sat Aug 21 2010 David Malcolm - 3.2-0.0.a1 -- 3.2a1; add alphatag -- rework %%files in the light of PEP 3147 (__pycache__) -- drop our configuration patch to Setup.dist (patch 0): setup.py should do a -better job of things, and the %%files explicitly lists our modules (r82746 -appears to break the old way of doing things). This leads to various modules -changing from "foomodule.so" to "foo.so". It also leads to the optimized build -dropping the _sha1, _sha256 and _sha512 modules, but these are provided by -_hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for -testing/devel purposes) -- fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase -- remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat -plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983) -- add machinery for rebuilding "configure" and friends, using the correct -version of autoconf (patch 300) -- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125) -- "modulator" was removed upstream -- drop "-b" from patch applications affecting .py files to avoid littering the -installation tree - -* Thu Aug 19 2010 Toshio Kuratomi - 3.1.2-13 -- Turn on computed-gotos. -- Fix for parallel make and graminit.c - -* Fri Jul 2 2010 David Malcolm - 3.1.2-12 -- rebuild - -* Fri Jul 2 2010 David Malcolm - 3.1.2-11 -- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to -a segfault running test_pyexpat.py (patch 110; upstream issue 9054; rhbz#610312) - -* Fri Jun 4 2010 David Malcolm - 3.1.2-10 -- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819) -- reformat whitespace in audioop.c (patch 106) -- CVE-2010-1634: fix various integer overflow checks in the audioop -module (patch 107) -- CVE-2010-2089: further checks within the audioop module (patch 108) -- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 109) - -* Thu May 27 2010 Dan Horák - 3.1.2-9 -- reading the timestamp counter is available only on some arches (see Python/ceval.c) - -* Wed May 26 2010 David Malcolm - 3.1.2-8 -- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os") -(patch 105) - -* Tue May 25 2010 David Malcolm - 3.1.2-7 -- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options -(patch 104); enable them and the WITH_TSC option within the debug build - -* Mon May 24 2010 David Malcolm - 3.1.2-6 -- build and install two different configurations of Python 3: debug and -standard, packaging the debug build in a new "python3-debug" subpackage -(patch 103) - -* Tue Apr 13 2010 David Malcolm - 3.1.2-5 -- exclude test_http_cookies when running selftests, due to hang seen on -http://koji.fedoraproject.org/koji/taskinfo?taskID=2088463 (cancelled after -11 hours) -- update python-gdb.py from v5 to py3k version submitted upstream - -* Wed Mar 31 2010 David Malcolm - 3.1.2-4 -- update python-gdb.py from v4 to v5 (improving performance and stability, -adding commands) - -* Thu Mar 25 2010 David Malcolm - 3.1.2-3 -- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference -cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets -and exceptions) - -* Wed Mar 24 2010 David Malcolm - 3.1.2-2 -- refresh gdb hooks to v3 (reworking how they are packaged) - -* Sun Mar 21 2010 David Malcolm - 3.1.2-1 -- update to 3.1.2: http://www.python.org/download/releases/3.1.2/ -- drop upstreamed patch 2 (.pyc permissions handling) -- drop upstream patch 5 (fix for the test_tk and test_ttk_* selftests) -- drop upstreamed patch 200 (path-fixing script) - -* Sat Mar 20 2010 David Malcolm - 3.1.1-28 -- fix typo in libpython.stp (rhbz:575336) - -* Fri Mar 12 2010 David Malcolm - 3.1.1-27 -- add pyfuntop.stp example (source 7) -- convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for -consistency with python.spec - -* Mon Feb 15 2010 Thomas Spura - 3.1.1-26 -- rebuild for new package of redhat-rpm-config (rhbz:564527) -- use 'install -p' when running 'make install' - -* Fri Feb 12 2010 David Malcolm - 3.1.1-25 -- split configure options into multiple lines for easy of editing -- add systemtap static markers (wcohen, mjw, dmalcolm; patch 8), a systemtap -tapset defining "python.function.entry" and "python.function.return" to make -the markers easy to use (dmalcolm; source 5), and an example of using the -tapset to the docs (dmalcolm; source 6) (rhbz:545179) - -* Mon Feb 8 2010 David Malcolm - 3.1.1-24 -- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to -%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from -ldconfig (bug 562980), and which should also ensure it becomes part of the -debuginfo subpackage, rather than the libs subpackage -- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream -configure script, and to avoid fragile scripts that try to figure this out -dynamically (e.g. for the -gdb.py change) - -* Mon Feb 8 2010 David Malcolm - 3.1.1-23 -- add gdb hooks for easier debugging (Source 4) - -* Thu Jan 28 2010 David Malcolm - 3.1.1-22 -- update python-3.1.1-config.patch to remove downstream customization of build -of pyexpat and elementtree modules -- add patch adapted from upstream (patch 7) to add support for building against -system expat; add --with-system-expat to "configure" invocation -- remove embedded copies of expat and zlib from source tree during "prep" - -* Mon Jan 25 2010 David Malcolm - 3.1.1-21 -- introduce %%{dynload_dir} macro -- explicitly list all lib-dynload files, rather than dynamically gathering the -payload into a temporary text file, so that we can be sure what we are -shipping -- introduce a macros.pybytecompile source file, to help with packaging python3 -modules (Source3; written by Toshio) -- rename "2to3-3" to "python3-2to3" to better reflect python 3 module packaging -plans - -* Mon Jan 25 2010 David Malcolm - 3.1.1-20 -- change python-3.1.1-config.patch to remove our downstream change to curses -configuration in Modules/Setup.dist, so that the curses modules are built using -setup.py with the downstream default (linking against libncursesw.so, rather -than libncurses.so), rather than within the Makefile; add a test to %%install -to verify the dso files that the curses module is linked against the correct -DSO (bug 539917; changes _cursesmodule.so -> _curses.so) - -* Fri Jan 22 2010 David Malcolm - 3.1.1-19 -- add %%py3dir macro to macros.python3 (to be used during unified python 2/3 -builds for setting up the python3 copy of the source tree) - -* Wed Jan 20 2010 David Malcolm - 3.1.1-18 -- move lib2to3 from -tools subpackage to main package (bug 556667) - -* Sun Jan 17 2010 David Malcolm - 3.1.1-17 -- patch Makefile.pre.in to avoid building static library (patch 6, bug 556092) - -* Fri Jan 15 2010 David Malcolm - 3.1.1-16 -- use the %%{_isa} macro to ensure that the python-devel dependency on python -is for the correct multilib arch (#555943) -- delete bundled copy of libffi to make sure we use the system one - -* Fri Jan 15 2010 David Malcolm - 3.1.1-15 -- fix the URLs output by pydoc so they point at python.org's 3.1 build of the -docs, rather than the 2.6 build - -* Wed Jan 13 2010 David Malcolm - 3.1.1-14 -- replace references to /usr with %%{_prefix}; replace references to -/usr/include with %%{_includedir} (Toshio) - -* Mon Jan 11 2010 David Malcolm - 3.1.1-13 -- fix permission on find-provides-without-python-sonames.sh from 775 to 755 - -* Mon Jan 11 2010 David Malcolm - 3.1.1-12 -- remove build-time requirements on tix and tk, since we already have -build-time requirements on the -devel subpackages for each of these (Thomas -Spura) -- replace usage of %%define with %%global (Thomas Spura) -- remove forcing of CC=gcc as this old workaround for bug 109268 appears to -longer be necessary -- move various test files from the "tools"/"tkinter" subpackages to the "test" -subpackage - -* Thu Jan 7 2010 David Malcolm - 3.1.1-11 -- add %%check section (thanks to Thomas Spura) -- update patch 4 to use correct shebang line -- get rid of stray patch file from buildroot - -* Tue Nov 17 2009 Andrew McNabb - 3.1.1-10 -- switched a few instances of "find |xargs" to "find -exec" for consistency. -- made the description of __os_install_post more accurate. - -* Wed Nov 4 2009 David Malcolm - 3.1.1-9 -- add macros.python3 to the -devel subpackage, containing common macros for use -when packaging python3 modules - -* Tue Nov 3 2009 David Malcolm - 3.1.1-8 -- add a provides of "python(abi)" (see bug 532118) -- fix issues identified by a.badger in package review (bug 526126, comment 39): - - use "3" thoughout metadata, rather than "3.*" - - remove conditional around "pkg-config openssl" - - use standard cleanup of RPM_BUILD_ROOT - - replace hardcoded references to /usr with _prefix macro - - stop removing egg-info files - - use /usr/bin/python3.1 rather than /use/bin/env python3.1 when fixing -up shebang lines - - stop attempting to remove no-longer-present .cvsignore files - - move the post/postun sections above the "files" sections - -* Thu Oct 29 2009 David Malcolm - 3.1.1-7 -- remove commented-away patch 51 (python-2.6-distutils_rpm.patch): the -O1 -flag is used by default in the upstream code -- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py -_init_posix(), so we include them in the core package, along with their parent -directories (bug 531901) - -* Tue Oct 27 2009 David Malcolm - 3.1.1-6 -- reword description, based on suggestion by amcnabb -- fix the test_email and test_imp selftests (patch 3 and patch 4 respectively) -- fix the test_tk and test_ttk_* selftests (patch 5) -- fix up the specfile's handling of shebang/perms to avoid corrupting -test_httpservers.py (sed command suggested by amcnabb) - -* Thu Oct 22 2009 David Malcolm - 3.1.1-5 -- fixup importlib/_bootstrap.py so that it correctly handles being unable to -open .pyc files for writing (patch 2, upstream issue 7187) -- actually apply the rpath patch (patch 1) - -* Thu Oct 22 2009 David Malcolm - 3.1.1-4 -- update patch0's setup of the crypt module to link it against libcrypt -- update patch0 to comment "datetimemodule" back out, so that it is built -using setup.py (see Setup, option 3), thus linking it statically against -timemodule.c and thus avoiding a run-time "undefined symbol: -_PyTime_DoubleToTimet" failure on "import datetime" - -* Wed Oct 21 2009 David Malcolm - 3.1.1-3 -- remove executable flag from various files that shouldn't have it -- fix end-of-line encodings -- fix a character encoding - -* Tue Oct 20 2009 David Malcolm - 3.1.1-2 -- disable invocation of brp-python-bytecompile in postprocessing, since -it would be with the wrong version of python (adapted from ivazquez' -python3000 specfile) -- use a custom implementation of __find_provides in order to filter out bogus -provides lines for the various .so modules -- fixup distutils/unixccompiler.py to remove standard library path from rpath -(patch 1, was Patch0 in ivazquez' python3000 specfile) -- split out libraries into a -libs subpackage -- update summaries and descriptions, basing content on ivazquez' specfile -- fixup executable permissions on .py, .xpm and .xbm files, based on work in -ivazquez's specfile -- get rid of DOS batch files -- fixup permissions for shared libraries from non-standard 555 to standard 755 -- move /usr/bin/python*-config to the -devel subpackage -- mark various directories as being documentation - -* Thu Sep 24 2009 Andrew McNabb 3.1.1-1 -- Initial package for Python 3. - From 2f822707637375b7e7883c8035091601c48e062f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Dec 2017 13:55:24 +0100 Subject: [PATCH 07/67] Add sources for 3.7.0a2 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 002f1fb..24ad9db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.3.tar.xz) = 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b +SHA512 (Python-3.7.0a2.tar.xz) = 604cef8fe079afad66f4df17752cb1afdc7d12abd392cb5995b16e83df392f56bd1ed88d6be9e0f3e9d7ea0dd394e497f6311547d277d9fd1ebd3eb039f7b068 From d673becd53fe3ce18146482b8c44b60570b3bd50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Dec 2017 13:57:42 +0100 Subject: [PATCH 08/67] Ignore stuff --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index dafa321..1107137 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /*.tar.* +/*.src.rpm +/results_python3* From c9349a73c79318fef15994b81d8ea36fc4c15eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 9 Jan 2018 22:16:51 +0100 Subject: [PATCH 09/67] Update to 3.7.0 alpha 4 --- 00102-lib64.patch | 58 +++++++++++------------ 00289-fix-nis-compilation.patch | 83 +++++++++++++++++++++++++++++++++ python37.spec | 19 +++++++- sources | 2 +- 4 files changed, 130 insertions(+), 32 deletions(-) create mode 100644 00289-fix-nis-compilation.patch diff --git a/00102-lib64.patch b/00102-lib64.patch index 61f9b52..b48feda 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -105,13 +105,13 @@ index 9ee4d31..53c8606 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index 99e7b4f..c4c98a6 100644 +index 266adf0..e8513b6 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase): self.assertEqual(dirs[1], wanted) elif os.sep == '/': - # OS X non-framwework builds, Linux, FreeBSD, etc + # OS X non-framework builds, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', + self.assertEqual(len(dirs), 2) @@ -120,7 +120,7 @@ index 99e7b4f..c4c98a6 100644 'site-packages') self.assertEqual(dirs[0], wanted) diff --git a/Makefile.pre.in b/Makefile.pre.in -index e8df8f7..a5a9d5e 100644 +index 59ba9d4..5780ed8 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -133,7 +133,7 @@ LIBDIR= @libdir@ @@ -133,41 +133,41 @@ index e8df8f7..a5a9d5e 100644 # Detailed destination directories diff --git a/Modules/getpath.c b/Modules/getpath.c -index dd3387a..1258fcd 100644 +index 85e737b..2a1fc79 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c -@@ -494,7 +494,7 @@ calculate_path(void) - _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); - _prefix = Py_DecodeLocale(PREFIX, NULL); - _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); -- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); -+ lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL); - - if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { - Py_FatalError( -@@ -683,7 +683,7 @@ calculate_path(void) - } - else - wcsncpy(zip_path, _prefix, MAXPATHLEN); -- joinpath(zip_path, L"lib/python00.zip"); -+ joinpath(zip_path, L"lib64/python00.zip"); - bufsz = wcslen(zip_path); /* Replace "00" with version */ - zip_path[bufsz - 6] = VERSION[0]; - zip_path[bufsz - 5] = VERSION[2]; -@@ -695,7 +695,7 @@ calculate_path(void) - fprintf(stderr, +@@ -500,7 +500,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config, "Could not find platform dependent libraries \n"); - wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); + } + wcsncpy(exec_prefix, calculate->exec_prefix, MAXPATHLEN); - joinpath(exec_prefix, L"lib/lib-dynload"); + joinpath(exec_prefix, L"lib64/lib-dynload"); } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ + } +@@ -742,7 +742,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix) + else { + wcsncpy(calculate->zip_path, calculate->prefix, MAXPATHLEN); + } +- joinpath(calculate->zip_path, L"lib/python00.zip"); ++ joinpath(calculate->zip_path, L"lib64/python00.zip"); + /* Replace "00" with version */ + size_t bufsz = wcslen(calculate->zip_path); +@@ -867,7 +867,7 @@ calculate_init(PyCalculatePath *calculate, + if (!calculate->prefix) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); + } +- calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len); ++ calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len); + if (!calculate->lib_python) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); + } diff --git a/setup.py b/setup.py -index 11c4ec6..c3e5512 100644 +index f1933f7..450cd8a 100644 --- a/setup.py +++ b/setup.py -@@ -513,7 +513,7 @@ class PyBuildExt(build_ext): +@@ -531,7 +531,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -176,7 +176,7 @@ index 11c4ec6..c3e5512 100644 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -809,11 +809,11 @@ class PyBuildExt(build_ext): +@@ -830,11 +830,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -190,7 +190,7 @@ index 11c4ec6..c3e5512 100644 extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -850,8 +850,8 @@ class PyBuildExt(build_ext): +@@ -871,8 +871,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/00289-fix-nis-compilation.patch b/00289-fix-nis-compilation.patch new file mode 100644 index 0000000..4d4e3dc --- /dev/null +++ b/00289-fix-nis-compilation.patch @@ -0,0 +1,83 @@ +diff --git a/setup.py b/setup.py +index 3eb6ad1..3437e48 100644 +--- a/setup.py ++++ b/setup.py +@@ -1331,20 +1331,14 @@ class PyBuildExt(build_ext): + exts.append( Extension('termios', ['termios.c']) ) + # Jeremy Hylton's rlimit interface + exts.append( Extension('resource', ['resource.c']) ) ++ else: ++ missing.extend(['resource', 'termios']) + +- # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'qnx6'] and +- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): +- if (self.compiler.find_library_file(lib_dirs, 'nsl')): +- libs = ['nsl'] +- else: +- libs = [] +- exts.append( Extension('nis', ['nismodule.c'], +- libraries = libs) ) +- else: +- missing.append('nis') ++ nis = self._detect_nis(inc_dirs, lib_dirs) ++ if nis is not None: ++ exts.append(nis) + else: +- missing.extend(['nis', 'resource', 'termios']) ++ missing.append('nis') + + # Curses support, requiring the System V version of curses, often + # provided by the ncurses library. +@@ -2179,6 +2173,51 @@ class PyBuildExt(build_ext): + ) + return ext + ++ def _detect_nis(self, inc_dirs, lib_dirs): ++ if host_platform in {'win32', 'cygwin', 'qnx6'}: ++ return None ++ ++ libs = [] ++ library_dirs = [] ++ includes_dirs = [] ++ ++ # Latest glibc has moved Sun RPC headers into tircp and nsl sub ++ # directories. rpc code has been moved to libtirpc. ++ rpcsvc_inc = find_file( ++ 'rpcsvc/yp_prot.h', inc_dirs, ++ ['/usr/local/include/nsl', '/usr/include/nsl'] ++ ) ++ rpc_inc = find_file( ++ 'rpc/rpc.h', inc_dirs, ++ ['/usr/local/include/tirpc', '/usr/include/tirpc'] ++ ) ++ if rpcsvc_inc is None or rpc_inc is None: ++ # not found ++ return None ++ includes_dirs.extend(rpcsvc_inc) ++ includes_dirs.extend(rpc_inc) ++ ++ if self.compiler.find_library_file(lib_dirs, 'nsl'): ++ libs.append('nsl') ++ else: ++ # libnsl-devel: check for libnsl in nsl/ subdirectory ++ nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in lib_dirs] ++ libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl') ++ if libnsl is not None: ++ library_dirs.append(os.path.dirname(libnsl)) ++ libs.append('nsl') ++ ++ if self.compiler.find_library_file(lib_dirs, 'tirpc'): ++ libs.append('tirpc') ++ ++ return Extension( ++ 'nis', ['nismodule.c'], ++ libraries=libs, ++ library_dirs=library_dirs, ++ include_dirs=includes_dirs ++ ) ++ ++ + class PyBuildInstall(install): + # Suppress the warning about installation into the lib_dynload + # directory, which is not in sys.path when running Python during diff --git a/python37.spec b/python37.spec index 57a4691..c373bb3 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Second alpha -%global prerel a2 +%global prerel a4 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.1.%{?prerel}%{?dist} +Release: 0.2.%{?prerel}%{?dist} License: Python @@ -203,6 +203,8 @@ BuildRequires: glibc-devel BuildRequires: gmp-devel BuildRequires: libappstream-glib BuildRequires: libffi-devel +BuildRequires: libnsl2-devel +BuildRequires: libtirpc-devel BuildRequires: libGL-devel BuildRequires: libuuid-devel BuildRequires: libX11-devel @@ -392,6 +394,14 @@ Patch273: 00273-skip-float-test.patch # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch +# 00289 # +# Fix the compilation of the nis module, as glibc removed the +# interfaces related to Sun RPC and they are now provided +# by libtirpc and libnsl2. +# See: https://fedoraproject.org/wiki/Changes/SunRPCRemoval +# and https://fedoraproject.org/wiki/Changes/NISIPv6 +# Fixed upstream: https://bugs.python.org/issue32521 +Patch289: 00289-fix-nis-compilation.patch # (New patches go here ^^^) # @@ -684,6 +694,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 +%patch289 -p1 # Remove files that should be generated by the build @@ -1674,6 +1685,10 @@ fi # ====================================================== %changelog +* Tue Jan 09 2018 Miro Hrončok - 3.7.0-0.2.a4 +- Update to 3.7.0 alpha 4 +- Fix the compilation of the nis module + * Tue Nov 28 2017 Miro Hrončok - 3.7.0-0.1.a2 - Update to 3.7.0 alpha 2 - Removed merged patches 262, 277, 279 diff --git a/sources b/sources index 24ad9db..9fd642f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0a2.tar.xz) = 604cef8fe079afad66f4df17752cb1afdc7d12abd392cb5995b16e83df392f56bd1ed88d6be9e0f3e9d7ea0dd394e497f6311547d277d9fd1ebd3eb039f7b068 +SHA512 (Python-3.7.0a4.tar.xz) = 3d9517fb381258e21548e3e88de88592adc75bc37fddf21e79149d7706d85f5df816ffcc170603ce93959c76d903d4fd4c0231b5b0b2b430c21701cc303d9e5a From 7f3ae64d2f98f00b8778b9693ad37fa3c295f4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 18 Jan 2018 16:02:54 +0100 Subject: [PATCH 10/67] Remove /usr/bin/python37 (#1526129) --- python37.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python37.spec b/python37.spec index c373bb3..24d57dc 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.2.%{?prerel}%{?dist} +Release: 0.3.%{?prerel}%{?dist} License: Python @@ -1089,7 +1089,7 @@ rm %{buildroot}%{_bindir}/2to3-%{pybasever} %if %{with flatpackage} # Remove stuff that would conflict with python3 package -mv %{buildroot}%{_bindir}/python{3,%{pyshortver}} +rm %{buildroot}%{_bindir}/python3 rm %{buildroot}%{_bindir}/pydoc3 rm %{buildroot}%{_bindir}/pathfix.py rm %{buildroot}%{_bindir}/idle3 @@ -1206,7 +1206,6 @@ fi %{_libexecdir}/system-python %else %{_bindir}/pydoc%{pybasever} -%{_bindir}/python%{pyshortver} %endif %{_bindir}/python%{pybasever} @@ -1685,6 +1684,9 @@ fi # ====================================================== %changelog +* Thu Jan 18 2018 Miro Hrončok - 3.7.0-0.3.a4 +- Remove /usr/bin/python37 (#1526129) + * Tue Jan 09 2018 Miro Hrončok - 3.7.0-0.2.a4 - Update to 3.7.0 alpha 4 - Fix the compilation of the nis module From 6a6d4a03245c076ec8686b8f96ac4ffd3f6ad4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 18 Jan 2018 16:03:21 +0100 Subject: [PATCH 11/67] Move install stuff from %check to %install, where it belongs (oops) --- python37.spec | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/python37.spec b/python37.spec index 24d57dc..5ff5696 100644 --- a/python37.spec +++ b/python37.spec @@ -1047,6 +1047,24 @@ mkdir -p %{buildroot}%{_libexecdir} ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python %endif +# There's no point of having this, as decided in +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +rm %{buildroot}%{_bindir}/2to3-%{pybasever} + +%if %{with flatpackage} +# Remove stuff that would conflict with python3 package +rm %{buildroot}%{_bindir}/python3 +rm %{buildroot}%{_bindir}/pydoc3 +rm %{buildroot}%{_bindir}/pathfix.py +rm %{buildroot}%{_bindir}/idle3 +rm %{buildroot}%{_bindir}/python3-* +rm %{buildroot}%{_bindir}/pyvenv +rm %{buildroot}%{_bindir}/2to3 +rm %{buildroot}%{_libdir}/libpython3.so +rm %{buildroot}%{_mandir}/man1/python3.1* +rm %{buildroot}%{_libdir}/pkgconfig/python3.pc +%endif + # ====================================================== # Checks for packaging issues @@ -1083,24 +1101,6 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done -# There's no point of having this, as decided in -# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 -rm %{buildroot}%{_bindir}/2to3-%{pybasever} - -%if %{with flatpackage} -# Remove stuff that would conflict with python3 package -rm %{buildroot}%{_bindir}/python3 -rm %{buildroot}%{_bindir}/pydoc3 -rm %{buildroot}%{_bindir}/pathfix.py -rm %{buildroot}%{_bindir}/idle3 -rm %{buildroot}%{_bindir}/python3-* -rm %{buildroot}%{_bindir}/pyvenv -rm %{buildroot}%{_bindir}/2to3 -rm %{buildroot}%{_libdir}/libpython3.so -rm %{buildroot}%{_mandir}/man1/python3.1* -rm %{buildroot}%{_libdir}/pkgconfig/python3.pc -%endif - # ====================================================== # Running the upstream test suite @@ -1686,6 +1686,7 @@ fi %changelog * Thu Jan 18 2018 Miro Hrončok - 3.7.0-0.3.a4 - Remove /usr/bin/python37 (#1526129) +- Move install stuff from %%check to %%install, where it belongs (oops) * Tue Jan 09 2018 Miro Hrončok - 3.7.0-0.2.a4 - Update to 3.7.0 alpha 4 From 08148d40f83b062a693eb1e23b71a686fcfda0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 20 Jan 2018 23:07:44 +0100 Subject: [PATCH 12/67] Rebuilt for switch to libxcrypt --- python37.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 5ff5696..cf18266 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.3.%{?prerel}%{?dist} +Release: 0.4.%{?prerel}%{?dist} License: Python @@ -1684,6 +1684,9 @@ fi # ====================================================== %changelog +* Sat Jan 20 2018 Björn Esser - 3.7.0-0.4.a4 +- Rebuilt for switch to libxcrypt + * Thu Jan 18 2018 Miro Hrončok - 3.7.0-0.3.a4 - Remove /usr/bin/python37 (#1526129) - Move install stuff from %%check to %%install, where it belongs (oops) From dc669abc1d3e49e9fb3055d6d89042fdd83d6081 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Thu, 18 Jan 2018 22:57:38 +0100 Subject: [PATCH 13/67] Remove the python3-tools package (bz#1312030) For more details see https://bugzilla.redhat.com/show_bug.cgi?id=1312030 Scope: - Remove the python3-tools package and `Tools/` library - Move /usr/bin/2to3 to python3-devel - Move /usr/bin/idle and idlelib to python3-idle - Provide python3-tools from python3-idle to keep upgrades sane - Remove tests for tools from python3-tests package Merges https://src.fedoraproject.org/rpms/python37/pull-request/4 --- python37.spec | 110 +++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/python37.spec b/python37.spec index cf18266..9f1b85b 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.4.%{?prerel}%{?dist} +Release: 0.5.%{?prerel}%{?dist} License: Python @@ -519,8 +519,21 @@ Requires: python3-rpm-generators # TODO change to a specific subpackage once available (#1218294) Requires: redhat-rpm-config +Provides: %{name}-2to3 = %{version}-%{release} +Provides: 2to3 = %{version}-%{release} + Conflicts: %{name} < %{version}-%{release} +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +# /usr/bin/2to3 was moved from python2-tools to python3-tools +# TODO Remove in Fedora 29 +Conflicts: python2-tools < 2.7.13-17 +Conflicts: python-tools < 2.7.13-17 +# https://bugzilla.redhat.com/show_bug.cgi?id=1312030 +# /usr/bin/2to3 was moved from python3-tools to python3-devel +# TODO Remove in Fedora 30 +Conflicts: python3-tools < 3.7 + # Shall be removed in Fedora 31 Obsoletes: platform-python-devel < %{platpyver} @@ -529,32 +542,35 @@ This package contains the header files and configuration needed to compile Python extension modules (typically written in C or C++), to embed Python into other programs, and to make binary distributions for Python libraries. -It also contains the necessary macros to build RPM packages with Python modules. +It also contains the necessary macros to build RPM packages with Python modules +and 2to3 tool, an automatic source converter from Python 2.X. -%package tools -Summary: A collection of tools included with Python including 2to3 and idle +%package idle +Summary: A basic graphical development environment for Python Requires: %{name} = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release} -Provides: %{name}-2to3 = %{version}-%{release} -Provides: %{name}-idle = %{version}-%{release} -Provides: 2to3 = %{version}-%{release} Provides: idle3 = %{version}-%{release} -# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 -# /usr/bin/2to3 was moved from here -# TODO Remove in Fedora 29 -Conflicts: python2-tools < 2.7.13-17 -Conflicts: python-tools < 2.7.13-17 +Provides: %{name}-tools = %{version}-%{release} +Provides: %{name}-tools%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-tools < %{version}-%{release} # Shall be removed in Fedora 31 Obsoletes: platform-python-tools < %{platpyver} -%description tools -This package contains several tools included with Python, including: -- 2to3, an automatic source converter from Python 2.X -- idle, a basic graphical development environment +%description idle +IDLE is Python’s Integrated Development and Learning Environment. + +IDLE has the following features: Python shell window (interactive +interpreter) with colorizing of code input, output, and error messages; +multi-window text editor with multiple undo, Python colorizing, +smart indent, call tips, auto completion, and other features; +search within any window, replace within editor windows, and +search through multiple files (grep); debugger with persistent +breakpoints, stepping, and viewing of global and local namespaces; +configuration, browsers, and other dialogs. %package tkinter @@ -572,7 +588,6 @@ the Python programming language. %package test Summary: The self-test suite for the main python3 package Requires: %{name} = %{version}-%{release} -Requires: %{name}-tools = %{version}-%{release} # Shall be removed in Fedora 31 Obsoletes: platform-python-test < %{platpyver} @@ -597,7 +612,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-test%{?_isa} = %{version}-%{release} Requires: %{name}-tkinter%{?_isa} = %{version}-%{release} -Requires: %{name}-tools%{?_isa} = %{version}-%{release} +Requires: %{name}-idle%{?_isa} = %{version}-%{release} %description debug python3-debug provides a version of the Python runtime with numerous debugging @@ -944,21 +959,6 @@ cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml %endif -# Development tools -install -m755 -d %{buildroot}%{pylibdir}/Tools -install Tools/README %{buildroot}%{pylibdir}/Tools/ -cp -ar Tools/freeze %{buildroot}%{pylibdir}/Tools/ -cp -ar Tools/i18n %{buildroot}%{pylibdir}/Tools/ -cp -ar Tools/pynche %{buildroot}%{pylibdir}/Tools/ -cp -ar Tools/scripts %{buildroot}%{pylibdir}/Tools/ - -# Documentation tools -install -m755 -d %{buildroot}%{pylibdir}/Doc -cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/ - -# Demo scripts -cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ - # Make sure distutils looks at the right pyconfig.h file # See https://bugzilla.redhat.com/show_bug.cgi?id=201434 # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate @@ -971,22 +971,21 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \ %{buildroot}%{pylibdir}/distutils/sysconfig.py \ %{buildroot}%{pylibdir}/sysconfig.py +# Install pathfix.py to bindir +# See https://github.com/fedora-python/python-rpm-porting/issues/24 +cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/ + # Switch all shebangs to refer to the specific Python version. # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, # so handle files named using other naming scheme separately. LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ Tools/scripts/pathfix.py \ -i "%{_bindir}/python%{pybasever}" \ - %{buildroot} %{buildroot}%{pylibdir}/Tools/scripts/*-*.py \ - %{buildroot}%{pylibdir}/Tools/pynche/{pynche,pynche.pyw} -# not covered, also redundant and useless: -rm %{buildroot}%{pylibdir}/Tools/scripts/{2to3,idle3,pydoc3,pyvenv} - - -# Move pathfix.py to bindir -# See https://github.com/fedora-python/python-rpm-porting/issues/24 -mv %{buildroot}%{pylibdir}/Tools/scripts/pathfix.py %{buildroot}%{_bindir}/ + %{buildroot} +# Remove tests for python3-tools which was removed in +# https://bugzilla.redhat.com/show_bug.cgi?id=1312030 +rm -rf %{buildroot}%{pylibdir}/test/test_tools # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: @@ -996,10 +995,6 @@ find %{buildroot} -name \*.py \ -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ -exec chmod a-x {} \; \) \) -# Remove executable flag from files that shouldn't have it: -chmod a-x \ - %{buildroot}%{pylibdir}/Tools/README - # Get rid of DOS batch files: find %{buildroot} -name \*.bat -exec rm {} \; @@ -1047,9 +1042,10 @@ mkdir -p %{buildroot}%{_libexecdir} ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python %endif -# There's no point of having this, as decided in -# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 -rm %{buildroot}%{_bindir}/2to3-%{pybasever} +# There's 2to3-X.X executable and 2to3 soft link to it. +# No reason to have both, so keep only 2to3 as an executable. +# See https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3 %if %{with flatpackage} # Remove stuff that would conflict with python3 package @@ -1267,8 +1263,6 @@ fi %{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} %endif -%{pylibdir}/idlelib - %dir %{pylibdir}/test/ %dir %{pylibdir}/test/__pycache__/ %dir %{pylibdir}/test/support/ @@ -1458,6 +1452,7 @@ fi %if %{without flatpackage} %files devel %defattr(-,root,root) +%{_bindir}/2to3 %endif %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* @@ -1486,17 +1481,16 @@ fi %if %{without flatpackage} -%files tools +%files idle %defattr(-,root,root,755) -%{_bindir}/2to3 %{_bindir}/idle* %else %{_bindir}/idle%{pybasever} %endif -%{pylibdir}/Tools -%doc %{pylibdir}/Doc +%{pylibdir}/idlelib + %if %{without flatpackage} %{_datadir}/appdata/idle3.appdata.xml %{_datadir}/applications/idle3.desktop @@ -1684,6 +1678,12 @@ fi # ====================================================== %changelog +* Fri Jan 26 2018 Iryna Shcherbina - 3.7.0-0.5.a4 +- Remove the python3-tools package (#rhbz 1312030) +- Move /usr/bin/2to3 to python3-devel +- Move /usr/bin/idle and idlelib to python3-idle +- Provide python3-tools from python3-idle + * Sat Jan 20 2018 Björn Esser - 3.7.0-0.4.a4 - Rebuilt for switch to libxcrypt From c86891d48830e86d86406143cf366247cea348bd Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 5 Feb 2018 17:59:56 +0100 Subject: [PATCH 14/67] Remove obsolete scriptlets that are now automatic. --- python37.spec | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/python37.spec b/python37.spec index 9f1b85b..db40e3b 100644 --- a/python37.spec +++ b/python37.spec @@ -1156,39 +1156,6 @@ CheckPython optimized %endif # with tests -# ====================================================== -# Scriptlets -# ====================================================== - -%if %{without flatpackage} - -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig - -%posttrans -/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - -%endif - - -%post -%if %{with flatpackage} -/sbin/ldconfig -%else -/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : -%endif - -%postun -%if %{with flatpackage} -/sbin/ldconfig -%else -if [ $1 -eq 0 ] ; then - /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null - /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : -fi -%endif - %files %defattr(-, root, root) %license LICENSE From 72d368458c8d100a5a33da8fc1361182955344a4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 12:01:54 +0000 Subject: [PATCH 15/67] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- python37.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index db40e3b..fee2c28 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.5.%{?prerel}%{?dist} +Release: 0.6.%{?prerel}%{?dist} License: Python @@ -1645,6 +1645,9 @@ CheckPython optimized # ====================================================== %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 3.7.0-0.6.a4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Fri Jan 26 2018 Iryna Shcherbina - 3.7.0-0.5.a4 - Remove the python3-tools package (#rhbz 1312030) - Move /usr/bin/2to3 to python3-devel From 31d212b3c7fa592942d18607d1146c189936e754 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 29 Nov 2017 16:09:30 +0100 Subject: [PATCH 16/67] Remove our downstream systemtap instrumentation as now upstream provides us with dtrace hooks. --- 00055-systemtap.patch | 762 ------------------------------------------ libpython.stp | 17 - pyfuntop.stp | 21 -- python37.spec | 63 ---- systemtap-example.stp | 19 -- 5 files changed, 882 deletions(-) delete mode 100644 00055-systemtap.patch delete mode 100644 libpython.stp delete mode 100644 pyfuntop.stp delete mode 100644 systemtap-example.stp diff --git a/00055-systemtap.patch b/00055-systemtap.patch deleted file mode 100644 index a48fe7c..0000000 --- a/00055-systemtap.patch +++ /dev/null @@ -1,762 +0,0 @@ -diff -up Python-3.3.0rc2/configure.ac.systemtap Python-3.3.0rc2/configure.ac ---- Python-3.3.0rc2/configure.ac.systemtap 2012-09-09 05:11:14.000000000 -0400 -+++ Python-3.3.0rc2/configure.ac 2012-09-10 09:17:21.114511781 -0400 -@@ -2678,6 +2678,23 @@ if test "$with_valgrind" != no; then - OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" - fi - -+# Check for systemtap support -+# On Linux, /usr/bin/dtrace is in fact a shim to SystemTap -+AC_MSG_CHECKING([for --with-systemtap]) -+AC_ARG_WITH([systemtap], -+ AC_HELP_STRING([--with(out)-systemtap], [disable/enable SystemTap support]),, -+ with_systemtap=no) -+AC_MSG_RESULT([$with_systemtap]) -+if test "$with_systemtap" != no; then -+ AC_DEFINE(WITH_SYSTEMTAP, 1, -+ [Define if you want to compile in SystemTap support]) -+ SYSTEMTAPOBJS="Python/pysystemtap.o" -+ SYSTEMTAPDEPS="\$(srcdir)/Python/pysystemtap.h" -+fi -+ -+AC_SUBST(SYSTEMTAPOBJS) -+AC_SUBST(SYSTEMTAPDEPS) -+ - # -I${DLINCLDIR} is added to the compile rule for importdl.o - AC_SUBST(DLINCLDIR) - DLINCLDIR=. -diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto/index.rst ---- Python-3.3.0rc2/Doc/howto/index.rst.systemtap 2012-09-09 05:10:51.000000000 -0400 -+++ Python-3.3.0rc2/Doc/howto/index.rst 2012-09-10 09:17:21.117511779 -0400 -@@ -29,4 +29,5 @@ Currently, the HOWTOs are: - argparse.rst - ipaddress.rst - clinic.rst -+ instrumentation.rst - -diff -up Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc2/Doc/howto/instrumentation.rst ---- Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap 2012-09-10 09:17:21.117511779 -0400 -+++ Python-3.3.0rc2/Doc/howto/instrumentation.rst 2012-09-10 09:17:21.117511779 -0400 -@@ -0,0 +1,295 @@ -+.. _instrumentation: -+ -+==================================== -+Instrumenting CPython with SystemTap -+==================================== -+ -+:author: David Malcolm -+ -+DTrace and SystemTap are monitoring tools, each providing a way to inspect -+what the processes on a computer system are doing. They both use -+domain-specific languages allowing a user to write scripts which: -+ -+ - filter which processes are to be observed -+ - gather data from the processes of interest -+ - generate reports on the data -+ -+As of Python 3.3, CPython can be built with embedded "markers" that can be -+observed by a SystemTap script, making it easier to monitor what the CPython -+processes on a system are doing. -+ -+.. Potentially this document could be expanded to also cover DTrace markers. -+ However, I'm not a DTrace expert. -+ -+.. I'm using ".. code-block:: c" for SystemTap scripts, as "c" is syntactically -+ the closest match that Sphinx supports -+ -+ -+Enabling the static markers -+--------------------------- -+ -+In order to build CPython with the embedded markers for SystemTap, the -+SystemTap development tools must be installed. -+ -+On a Fedora or Red Hat Enterprise Linux machine, this can be done via:: -+ -+ yum install systemtap-sdt-devel -+ -+CPython must then be configured `--with-systemtap`:: -+ -+ checking for --with-systemtap... yes -+ -+You can verify if the SystemTap static markers are present in the built -+binary by seeing if it contains a ".note.stapsdt" section. -+ -+.. code-block:: bash -+ -+ $ eu-readelf -S ./python | grep .note.stapsdt -+ [29] .note.stapsdt NOTE 0000000000000000 00308d78 000000b8 0 0 0 4 -+ -+If you've built python as a shared library (with --enable-shared), you need -+to look instead within the shared library. For example: -+ -+.. code-block:: bash -+ -+ $ eu-readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt -+ [28] .note.stapsdt NOTE 0000000000000000 00365b68 000000b8 0 0 0 4 -+ -+Earlier versions of SystemTap stored the markers in a ".probes" section. -+ -+For the curious, you can see the metadata for the static markers using this -+invocation. -+ -+.. code-block:: bash -+ -+ $ eu-readelf -x .note.stapsdt ./python -+ -+ Hex dump of section [29] '.note.stapsdt', 184 bytes at offset 0x308d78: -+ 0x00000000 08000000 45000000 03000000 73746170 ....E.......stap -+ 0x00000010 73647400 d4664b00 00000000 4fc36600 sdt..fK.....O.f. -+ 0x00000020 00000000 488d9000 00000000 70797468 ....H.......pyth -+ 0x00000030 6f6e0066 756e6374 696f6e5f 5f656e74 on.function__ent -+ 0x00000040 72790038 40257261 78203840 25726478 ry.8@%rax 8@%rdx -+ 0x00000050 202d3440 25656378 00000000 08000000 -4@%ecx........ -+ 0x00000060 46000000 03000000 73746170 73647400 F.......stapsdt. -+ 0x00000070 0d674b00 00000000 4fc36600 00000000 .gK.....O.f..... -+ 0x00000080 4a8d9000 00000000 70797468 6f6e0066 J.......python.f -+ 0x00000090 756e6374 696f6e5f 5f726574 75726e00 unction__return. -+ 0x000000a0 38402572 61782038 40257264 78202d34 8@%rax 8@%rdx -4 -+ 0x000000b0 40256563 78000000 @%ecx... -+ -+and a sufficiently modern eu-readelf can print the metadata: -+ -+.. code-block:: bash -+ -+ $ eu-readelf -n ./python -+ -+ Note section [ 1] '.note.gnu.build-id' of 36 bytes at offset 0x190: -+ Owner Data size Type -+ GNU 20 GNU_BUILD_ID -+ Build ID: a28f8db1b224530b0d38ad7b82a249cf7c3f18d6 -+ -+ Note section [27] '.note.stapsdt' of 184 bytes at offset 0x1ae884: -+ Owner Data size Type -+ stapsdt 70 Version: 3 -+ PC: 0xe0d3a, Base: 0x14b150, Semaphore: 0x3ae882 -+ Provider: python, Name: function__return, Args: '8@%rbx 8@%r13 -4@%eax' -+ stapsdt 69 Version: 3 -+ PC: 0xe0f37, Base: 0x14b150, Semaphore: 0x3ae880 -+ Provider: python, Name: function__entry, Args: '8@%rbx 8@%r13 -4@%eax' -+ -+The above metadata contains information for SystemTap describing how it can -+patch strategically-placed machine code instructions to enable the tracing -+hooks used by a SystemTap script. -+ -+ -+Static markers -+-------------- -+ -+The low-level way to use the SystemTap integration is to use the static -+markers directly. This requires you to explicitly state the binary file -+containing them. -+ -+For example, this script can be used to show the call/return hierarchy of a -+Python script: -+ -+.. code-block:: c -+ -+ probe process('python').mark("function__entry") { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ -+ printf("%s => %s in %s:%d\\n", -+ thread_indent(1), funcname, filename, lineno); -+ } -+ -+ probe process('python').mark("function__return") { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ -+ printf("%s <= %s in %s:%d\\n", -+ thread_indent(-1), funcname, filename, lineno); -+ } -+ -+It can be invoked like this: -+ -+.. code-block:: bash -+ -+ $ stap \ -+ show-call-hierarchy.stp \ -+ -c ./python test.py -+ -+The output looks like this:: -+ -+ 11408 python(8274): => __contains__ in Lib/_abcoll.py:362 -+ 11414 python(8274): => __getitem__ in Lib/os.py:425 -+ 11418 python(8274): => encode in Lib/os.py:490 -+ 11424 python(8274): <= encode in Lib/os.py:493 -+ 11428 python(8274): <= __getitem__ in Lib/os.py:426 -+ 11433 python(8274): <= __contains__ in Lib/_abcoll.py:366 -+ -+where the columns are: -+ -+ - time in microseconds since start of script -+ -+ - name of executable -+ -+ - PID of process -+ -+and the remainder indicates the call/return hierarchy as the script executes. -+ -+For a `--enable-shared` build of CPython, the markers are contained within the -+libpython shared library, and the probe's dotted path needs to reflect this. For -+example, this line from the above example:: -+ -+ probe process('python').mark("function__entry") { -+ -+should instead read:: -+ -+ probe process('python').library("libpython3.3dm.so.1.0").mark("function__entry") { -+ -+(assuming a debug build of CPython 3.3) -+ -+.. I'm reusing the "c:function" type for markers -+ -+.. c:function:: function__entry(str filename, str funcname, int lineno) -+ -+ This marker indicates that execution of a Python function has begun. It is -+ only triggered for pure-python (bytecode) functions. -+ -+ The filename, function name, and line number are provided back to the -+ tracing script as positional arguments, which must be accessed using -+ `$arg1`, `$arg2`: -+ -+ * `$arg1` : `(const char *)` filename, accessible using `user_string($arg1)` -+ -+ * `$arg2` : `(const char *)` function name, accessible using -+ `user_string($arg2)` -+ -+ * `$arg3` : `int` line number -+ -+ * `$arg4` : `(PyFrameObject *)`, the frame being executed -+ -+.. c:function:: function__return(str filename, str funcname, int lineno) -+ -+ This marker is the converse of `function__entry`, and indicates that -+ execution of a Python function has ended (either via ``return``, or via an -+ exception). It is only triggered for pure-python (bytecode) functions. -+ -+ The arguments are the same as for `function__entry` -+ -+ -+Tapsets -+------- -+ -+The higher-level way to use the SystemTap integration is to use a "tapset": -+SystemTap's equivalent of a library, which hides some of the lower-level -+details of the static markers. -+ -+Here is a tapset file, based on a non-shared build of CPython: -+ -+.. code-block:: c -+ -+ /* -+ Provide a higher-level wrapping around the function__entry and -+ function__return markers: -+ */ -+ probe python.function.entry = process("python").mark("function__entry") -+ { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ frameptr = $arg4 -+ } -+ probe python.function.return = process("python").mark("function__return") -+ { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ frameptr = $arg4 -+ } -+ -+If this file is installed in SystemTap's tapset directory (e.g. -+`/usr/share/systemtap/tapset`), then these additional probepoints become -+available: -+ -+.. c:function:: python.function.entry(str filename, str funcname, int lineno, frameptr) -+ -+ This probe point indicates that execution of a Python function has begun. -+ It is only triggered for pure-python (bytecode) functions. -+ -+.. c:function:: python.function.return(str filename, str funcname, int lineno, frameptr) -+ -+ This probe point is the converse of `python.function.return`, and indicates -+ that execution of a Python function has ended (either via ``return``, or -+ via an exception). It is only triggered for pure-python (bytecode) functions. -+ -+ -+Examples -+-------- -+This SystemTap script uses the tapset above to more cleanly implement the -+example given above of tracing the Python function-call hierarchy, without -+needing to directly name the static markers: -+ -+.. code-block:: c -+ -+ probe python.function.entry -+ { -+ printf("%s => %s in %s:%d\n", -+ thread_indent(1), funcname, filename, lineno); -+ } -+ -+ probe python.function.return -+ { -+ printf("%s <= %s in %s:%d\n", -+ thread_indent(-1), funcname, filename, lineno); -+ } -+ -+ -+The following script uses the tapset above to provide a top-like view of all -+running CPython code, showing the top 20 most frequently-entered bytecode -+frames, each second, across the whole system: -+ -+.. code-block:: c -+ -+ global fn_calls; -+ -+ probe python.function.entry -+ { -+ fn_calls[pid(), filename, funcname, lineno] += 1; -+ } -+ -+ probe timer.ms(1000) { -+ printf("\033[2J\033[1;1H") /* clear screen */ -+ printf("%6s %80s %6s %30s %6s\n", -+ "PID", "FILENAME", "LINE", "FUNCTION", "CALLS") -+ foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) { -+ printf("%6d %80s %6d %30s %6d\n", -+ pid, filename, lineno, funcname, -+ fn_calls[pid, filename, funcname, lineno]); -+ } -+ delete fn_calls; -+ } -+ -diff -up Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc2/Lib/test/test_systemtap.py ---- Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap 2012-09-10 09:17:21.117511779 -0400 -+++ Python-3.3.0rc2/Lib/test/test_systemtap.py 2012-09-10 09:17:21.117511779 -0400 -@@ -0,0 +1,234 @@ -+# Verify that systemtap static probes work -+# -+import subprocess -+import sys -+import sysconfig -+import os -+import unittest -+ -+from test.support import run_unittest, TESTFN, unlink -+ -+if '--with-systemtap' not in sysconfig.get_config_var('CONFIG_ARGS'): -+ raise unittest.SkipTest("Python was not configured --with-systemtap") -+ -+try: -+ _, stap_version = subprocess.Popen(["stap", "-V"], -+ stdout=subprocess.PIPE, -+ stderr=subprocess.PIPE, -+ ).communicate() -+except OSError: -+ # This is what "no stap" looks like. There may, however, be other -+ # errors that manifest this way too. -+ raise unittest.SkipTest("Couldn't find stap on the path") -+ -+def invoke_systemtap_script(script, cmd): -+ # Start a child process, probing with the given systemtap script -+ # (passed as stdin to the "stap" tool) -+ # The script should be a bytes instance -+ # Return (stdout, stderr) pair -+ -+ p = subprocess.Popen(["stap", "-", '-vv', '-c', cmd], -+ stdin=subprocess.PIPE, -+ stdout=subprocess.PIPE, -+ stderr=subprocess.PIPE) -+ out, err = p.communicate(input=script) -+ return out, err -+ -+# Verify that stap can run a simple "hello world"-style script -+# This can fail for various reasons: -+# - missing kernel headers -+# - permissions (a non-root user needs to be in the "stapdev" group) -+TRIVIAL_STAP_SCRIPT = b'probe begin { println("hello world") exit () }' -+ -+out, err = invoke_systemtap_script(TRIVIAL_STAP_SCRIPT, 'true') -+if out != b'hello world\n': -+ raise unittest.SkipTest("Test systemtap script did not run; stderr was: %s" % err) -+ -+# We don't expect stderr to be empty, since we're invoking stap with "-vv": stap -+# will (we hope) generate debugging output on stderr. -+ -+def invoke_python_under_systemtap(script, pythoncode=None, pythonfile=None): -+ # Start a child python process, probing with the given systemtap script -+ # (passed as stdin to the "stap" tool) -+ # The script should be a bytes instance -+ # Return (stdout, stderr) pair -+ -+ if pythonfile: -+ pythoncmd = '%s %s' % (sys.executable, pythonfile) -+ else: -+ pythoncmd = '%s -c %r' % (sys.executable, pythoncode) -+ -+ # The process tree of a stap invocation of a command goes through -+ # something like this: -+ # stap ->fork/exec(staprun; exec stapio ->f/e(-c cmd); exec staprun -r) -+ # and this trip through setuid leads to LD_LIBRARY_PATH being dropped, -+ # which would lead to an --enable-shared build of python failing to be -+ # find its libpython, with an error like: -+ # error while loading shared libraries: libpython3.3dm.so.1.0: cannot -+ # open shared object file: No such file or directory -+ # Hence we need to jump through some hoops to expose LD_LIBRARY_PATH to -+ # the invoked python process: -+ LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') -+ if LD_LIBRARY_PATH: -+ pythoncmd = 'env LD_LIBRARY_PATH=%s ' % LD_LIBRARY_PATH + pythoncmd -+ -+ return invoke_systemtap_script(script, pythoncmd) -+ -+# When using the static markers, we need to supply the prefix of a systemtap -+# dotted probe point that containing the marker. -+# See http://sourceware.org/systemtap/langref/Probe_points.html -+# -+# We need to determine if this is a shared-library build -+# -+# Note that sysconfig can get this wrong; see: -+# http://bugs.python.org/issue14774 -+# -+if '--enable-shared' in sysconfig.get_config_var('CONFIG_ARGS'): -+ # For a shared-library build, the markers are in library(INSTSONAME): -+ INSTSONAME = sysconfig.get_config_var('INSTSONAME') -+ probe_prefix = 'process("%s").library("%s")' % (sys.executable, INSTSONAME) -+else: -+ # For a non-shared-library build, we can simply use sys.executable: -+ probe_prefix = 'process("%s")' % sys.executable -+ -+# The following script ought to generate lots of lines showing recursive -+# function entry and return, of the form: -+# 11408 python(8274): => __contains__ in Lib/_abcoll.py:362 -+# 11414 python(8274): => __getitem__ in Lib/os.py:425 -+# 11418 python(8274): => encode in Lib/os.py:490 -+# 11424 python(8274): <= encode in Lib/os.py:493 -+# 11428 python(8274): <= __getitem__ in Lib/os.py:426 -+# 11433 python(8274): <= __contains__ in Lib/_abcoll.py:366 -+# where the column are: -+# - time in microseconds since start of script -+# - name of executable -+# - PID of process -+# and the remainder indicates the call/return hierarchy -+ -+hierarchy_script = (''' -+probe %s.mark("function__entry") { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ -+ printf("%%s => %%s in %%s:%%d\\n", thread_indent(1), funcname, filename, lineno); -+} -+ -+probe %s.mark("function__return") { -+ filename = user_string($arg1); -+ funcname = user_string($arg2); -+ lineno = $arg3; -+ -+ printf("%%s <= %%s in %%s:%%d\\n", thread_indent(-1), funcname, filename, lineno); -+} -+''' % (probe_prefix, probe_prefix)).encode('utf-8') -+ -+ -+class ErrorDumper: -+ # A context manager that dumps extra information if an exception is raised, -+ # to help track down why the problem occurred -+ def __init__(self, out, err): -+ self.out = out -+ self.err = err -+ -+ def __enter__(self): -+ pass -+ -+ def __exit__(self, type_, value, traceback): -+ if type_: -+ # an exception is being raised: -+ print('stdout: %s' % out.decode()) -+ print('stderr: %s' % err.decode()) -+ -+class SystemtapTests(unittest.TestCase): -+ -+ def test_invoking_python(self): -+ # Ensure that we can invoke python under stap, with a trivial stap -+ # script: -+ out, err = invoke_python_under_systemtap( -+ b'probe begin { println("hello from stap") exit () }', -+ pythoncode="print('hello from python')") -+ with ErrorDumper(out, err): -+ self.assertIn(b'hello from stap', out) -+ self.assertIn(b'hello from python', out) -+ -+ def test_function_entry(self): -+ # Ensure that the function_entry static marker works -+ out, err = invoke_python_under_systemtap(hierarchy_script) -+ # stdout ought to contain various lines showing recursive function -+ # entry and return (see above) -+ -+ # Uncomment this for debugging purposes: -+ # print(out.decode('utf-8')) -+ -+ # Executing the cmdline-supplied "pass": -+ # 0 python(8274): => in :1 -+ # 5 python(8274): <= in :1 -+ with ErrorDumper(out, err): -+ self.assertIn(b'=> in :1', out, -+ msg="stdout: %s\nstderr: %s\n" % (out, err)) -+ -+ def test_function_encoding(self): -+ # Ensure that function names containing non-Latin 1 code -+ # points are handled: -+ pythonfile = TESTFN -+ try: -+ unlink(pythonfile) -+ f = open(pythonfile, "wb") -+ f.write(""" -+# Sample script with non-ASCII filename, for use by test_systemtap.py -+# Implicitly UTF-8 -+ -+def 文字化け(): -+ '''Function with non-ASCII identifier; I believe this reads "mojibake"''' -+ print("hello world!") -+ -+文字化け() -+""".encode('utf-8')) -+ f.close() -+ -+ out, err = invoke_python_under_systemtap(hierarchy_script, -+ pythonfile=pythonfile) -+ out_utf8 = out.decode('utf-8') -+ with ErrorDumper(out, err): -+ self.assertIn('=> in %s:5' % pythonfile, out_utf8) -+ self.assertIn(' => 文字化け in %s:5' % pythonfile, out_utf8) -+ self.assertIn(' <= 文字化け in %s:7' % pythonfile, out_utf8) -+ self.assertIn('<= in %s:9' % pythonfile, out_utf8) -+ finally: -+ unlink(pythonfile) -+ -+ @unittest.skipIf(sys.getfilesystemencoding() == 'ascii', -+ 'the test filename is not encodable with ASCII') -+ def test_filename_encoding(self): -+ # Ensure that scripts names containing non-Latin 1 code -+ # points are handled: -+ pythonfile = TESTFN + '_☠.py' -+ try: -+ unlink(pythonfile) -+ f = open(pythonfile, "wb") -+ f.write(""" -+def foo(): -+ '''Function with non-ASCII identifier; I believe this reads "mojibake"''' -+ print("hello world!") -+ -+foo() -+""".encode('utf-8')) -+ f.close() -+ -+ out, err = invoke_python_under_systemtap(hierarchy_script, -+ pythonfile=pythonfile) -+ out_utf8 = out.decode('utf-8') -+ with ErrorDumper(out, err): -+ self.assertIn('=> in %s:2' % pythonfile, out_utf8) -+ self.assertIn(' => foo in %s:2' % pythonfile, out_utf8) -+ self.assertIn(' <= foo in %s:4' % pythonfile, out_utf8) -+ self.assertIn('<= in %s:6' % pythonfile, out_utf8) -+ finally: -+ unlink(pythonfile) -+ -+def test_main(): -+ run_unittest(SystemtapTests) -+ -+if __name__ == "__main__": -+ test_main() -diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre.in ---- Python-3.3.0rc2/Makefile.pre.in.systemtap 2012-09-09 05:11:05.000000000 -0400 -+++ Python-3.3.0rc2/Makefile.pre.in 2012-09-10 09:19:51.195501518 -0400 -@@ -363,6 +363,7 @@ PYTHON_OBJS= \ - Python/formatter_unicode.o \ - Python/fileutils.o \ - Python/$(DYNLOADFILE) \ -+ @SYSTEMTAPOBJS@ \ - $(LIBOBJS) \ - $(MACHDEP_OBJS) \ - $(THREADOBJ) -@@ -713,7 +714,8 @@ Objects/setobject.o: $(srcdir)/Objects/s - $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) - $(OPCODETARGETGEN) $(OPCODETARGETS_H) - --Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h -+Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \ -+ $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@ - - Python/frozen.o: Python/importlib.h Python/importlib_external.h - -@@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ - Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py - $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc - -+# Only needed with --with-systemtap; not a public header: -+$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d -+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/pysystemtap.d -+ -+Python/pysystemtap.o: $(srcdir)/Python/pysystemtap.d Python/ceval.o -+ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/pysystemtap.d Python/ceval.o -+ - ############################################################################ - # Header files - -@@ -1345,6 +1354,7 @@ clean: pycremoval - -rm -f Lib/lib2to3/*Grammar*.pickle - -rm -f Programs/_testembed Programs/_freeze_importlib - -rm -rf build -+ -rm -f $(srcdir)/Python/pysystemtap.h - - profile-removal: - find . -name '*.gc??' -exec rm -f {} ';' -diff -up Python-3.3.0rc2/pyconfig.h.in.systemtap Python-3.3.0rc2/pyconfig.h.in ---- Python-3.3.0rc2/pyconfig.h.in.systemtap 2012-09-09 05:11:14.000000000 -0400 -+++ Python-3.3.0rc2/pyconfig.h.in 2012-09-10 09:17:21.120511781 -0400 -@@ -1306,6 +1306,9 @@ - /* Define if you want to compile in Python-specific mallocs */ - #undef WITH_PYMALLOC - -+/* Define if you want to compile in SystemTap support */ -+#undef WITH_SYSTEMTAP -+ - /* Define if you want to compile in rudimentary thread support */ - #undef WITH_THREAD - -diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c ---- Python-3.3.0rc2/Python/ceval.c.systemtap 2012-09-09 05:11:12.000000000 -0400 -+++ Python-3.3.0rc2/Python/ceval.c 2012-09-10 09:17:21.122511781 -0400 -@@ -18,6 +18,8 @@ - - #include - -+#include "ceval_systemtap.h" -+ - #ifndef WITH_TSC - - #define READ_TIMESTAMP(var) -@@ -1160,6 +1162,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int - } - } - -+ if (PYTHON_FUNCTION_ENTRY_ENABLED()) { -+ systemtap_function_entry(f); -+ } -+ - co = f->f_code; - names = co->co_names; - consts = co->co_consts; -@@ -3077,6 +3083,11 @@ fast_yield: - - /* pop frame */ - exit_eval_frame: -+ -+ if (PYTHON_FUNCTION_RETURN_ENABLED()) { -+ systemtap_function_return(f); -+ } -+ - Py_LeaveRecursiveCall(); - f->f_executing = 0; - tstate->frame = f->f_back; -diff -up Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap Python-3.3.0rc2/Python/ceval_systemtap.h ---- Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap 2012-09-10 09:17:21.122511781 -0400 -+++ Python-3.3.0rc2/Python/ceval_systemtap.h 2012-09-10 09:17:21.122511781 -0400 -@@ -0,0 +1,86 @@ -+/* -+ Support for SystemTap static markers -+*/ -+ -+#ifdef WITH_SYSTEMTAP -+ -+#include "pysystemtap.h" -+ -+/* -+ A struct to hold all of the information gathered when one of the traceable -+ markers is triggered -+*/ -+struct frame_marker_info -+{ -+ PyObject *filename_obj; -+ PyObject *funcname_obj; -+ const char *filename; -+ const char *funcname; -+ int lineno; -+}; -+ -+static void -+get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) -+{ -+ PyObject *ptype; -+ PyObject *pvalue; -+ PyObject *ptraceback; -+ -+ PyErr_Fetch(&ptype, &pvalue, &ptraceback); -+ -+ fmi->filename_obj = PyUnicode_EncodeFSDefault(f->f_code->co_filename); -+ if (fmi->filename_obj) { -+ fmi->filename = PyBytes_AsString(fmi->filename_obj); -+ } else { -+ fmi->filename = NULL; -+ } -+ -+ fmi->funcname_obj = PyUnicode_AsUTF8String(f->f_code->co_name); -+ if (fmi->funcname_obj) { -+ fmi->funcname = PyBytes_AsString(fmi->funcname_obj); -+ } else { -+ fmi->funcname = NULL; -+ } -+ -+ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); -+ -+ PyErr_Restore(ptype, pvalue, ptraceback); -+ -+} -+ -+static void -+release_frame_marker_info(struct frame_marker_info *fmi) -+{ -+ Py_XDECREF(fmi->filename_obj); -+ Py_XDECREF(fmi->funcname_obj); -+} -+ -+static void -+systemtap_function_entry(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.funcname, fmi.lineno, f); -+ release_frame_marker_info(&fmi); -+} -+ -+static void -+systemtap_function_return(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.funcname, fmi.lineno, f); -+ release_frame_marker_info(&fmi); -+} -+ -+#else /* #ifdef WITH_SYSTEMTAP */ -+ -+/* -+ When configured --without-systemtap, everything compiles away to nothing: -+*/ -+#define PYTHON_FUNCTION_ENTRY_ENABLED() 0 -+#define PYTHON_FUNCTION_RETURN_ENABLED() 0 -+#define systemtap_function_entry(f) -+#define systemtap_function_return(f) -+ -+#endif -diff -up Python-3.3.0rc2/Python/pysystemtap.d.systemtap Python-3.3.0rc2/Python/pysystemtap.d ---- Python-3.3.0rc2/Python/pysystemtap.d.systemtap 2012-09-10 09:17:21.122511781 -0400 -+++ Python-3.3.0rc2/Python/pysystemtap.d 2012-09-10 09:17:21.122511781 -0400 -@@ -0,0 +1,4 @@ -+provider python { -+ probe function__entry(const char *, const char *, int, PyFrameObject *); -+ probe function__return(const char *, const char *, int, PyFrameObject *); -+}; diff --git a/libpython.stp b/libpython.stp deleted file mode 100644 index f41da80..0000000 --- a/libpython.stp +++ /dev/null @@ -1,17 +0,0 @@ -/* Systemtap tapset to make it easier to trace Python */ - -/* - Define python.function.entry/return: -*/ -probe python.function.entry = process("python3").library("LIBRARY_PATH").mark("function__entry") -{ - filename = user_string($arg1); - funcname = user_string($arg2); - lineno = $arg3; -} -probe python.function.return = process("python3").library("LIBRARY_PATH").mark("function__return") -{ - filename = user_string($arg1); - funcname = user_string($arg2); - lineno = $arg3; -} diff --git a/pyfuntop.stp b/pyfuntop.stp deleted file mode 100644 index f235a23..0000000 --- a/pyfuntop.stp +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/stap - -global fn_calls; - -probe python.function.entry -{ - fn_calls[pid(), filename, funcname, lineno] += 1; -} - -probe timer.ms(1000) { - printf("\033[2J\033[1;1H") /* clear screen */ - printf("%6s %80s %6s %30s %6s\n", - "PID", "FILENAME", "LINE", "FUNCTION", "CALLS") - foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) { - printf("%6d %80s %6d %30s %6d\n", - pid, filename, lineno, funcname, - fn_calls[pid, filename, funcname, lineno]); - } - - delete fn_calls; -} diff --git a/python37.spec b/python37.spec index fee2c28..52118c0 100644 --- a/python37.spec +++ b/python37.spec @@ -68,9 +68,6 @@ License: Python # Support for the GDB debugger %bcond_without gdb_hooks -# Support for systemtap instrumentation -%bcond_with systemtap - # The dbm.gnu module (key-value database) %bcond_without gdbm @@ -216,12 +213,6 @@ BuildRequires: readline-devel BuildRequires: sqlite-devel BuildRequires: gdb -%if %{with systemtap} -BuildRequires: systemtap-devel -BuildRequires: systemtap-sdt-devel -%global tapsetdir /usr/share/systemtap/tapset -%endif - BuildRequires: tar BuildRequires: tcl-devel BuildRequires: tix-devel @@ -256,19 +247,6 @@ Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}. # with different Python runtimes as necessary: Source3: macros.pybytecompile%{pybasever} -# Systemtap tapset to make it easier to use the systemtap static probes -# (actually a template; LIBRARY_PATH will get fixed up during install) -# Written by dmalcolm; not yet sent upstream -Source5: libpython.stp - -# Example systemtap script using the tapset -# Written by wcohen, mjw, dmalcolm; not yet sent upstream -Source6: systemtap-example.stp - -# Another example systemtap script that uses the tapset -# Written by dmalcolm; not yet sent upstream -Source7: pyfuntop.stp - # A simple script to check timestamps of bytecode files # Run in check section with Python that is currently being built # Written by bkabrda @@ -289,13 +267,6 @@ Source11: idle3.appdata.xml # Was Patch0 in ivazquez' python3000 specfile: Patch1: 00001-rpath.patch -# 00055 # -# Systemtap support: add statically-defined probe points -# Patch sent upstream as http://bugs.python.org/issue14776 -# with some subsequent reworking to cope with LANG=C in an rpmbuild -# (where sys.getfilesystemencoding() == 'ascii') -Patch55: 00055-systemtap.patch - # 00102 # # Change the various install paths to use /usr/lib64/ instead or /usr/lib # Only used when "%{_lib}" == "lib64" @@ -662,12 +633,6 @@ version once Python %{pybasever} is stable. %prep %setup -q -n Python-%{version}%{?prerel} -%if %{with systemtap} -# Provide an example of usage of the tapset: -cp -a %{SOURCE6} . -cp -a %{SOURCE7} . -%endif # with systemtap - # Remove bundled libraries to ensure that we're using the system copy. rm -r Modules/expat @@ -681,10 +646,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # %patch1 -p1 -%if %{with systemtap} -%patch55 -p1 -b .systemtap -%endif - %if "%{_lib}" == "lib64" %patch102 -p1 %endif @@ -781,9 +742,6 @@ BuildPython() { --enable-loadable-sqlite-extensions \ --with-dtrace \ --with-lto \ -%if %{with systemtap} - --with-systemtap \ -%endif %if %{with valgrind} --with-valgrind \ %endif @@ -905,16 +863,6 @@ InstallPython() { #endif EOF - # Systemtap hooks -%if %{with systemtap} - mkdir -p %{buildroot}%{tapsetdir} - sed \ - -e "s|LIBRARY_PATH|%{_libdir}/${PyInstSoName}|" \ - -e 's|"python3"|"python3${Postfix}"|' \ - %{_sourcedir}/libpython.stp \ - > %{buildroot}%{tapsetdir}/libpython%{pybasever}${Postfix}-%{wordsize}.stp -%endif # with systemtap - echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -1408,12 +1356,6 @@ CheckPython optimized %if %{without flatpackage} %{_libdir}/libpython3.so %endif -%if %{with systemtap} -%dir %(dirname %{tapsetdir}) -%dir %{tapsetdir} -%{tapsetdir}/%{libpython_stp_optimized} -%doc systemtap-example.stp pyfuntop.stp -%endif %if %{without flatpackage} @@ -1594,11 +1536,6 @@ CheckPython optimized # now; they're listed below, under "-devel": %{_libdir}/%{py_INSTSONAME_debug} -%if %{with systemtap} -%dir %(dirname %{tapsetdir}) -%dir %{tapsetdir} -%{tapsetdir}/%{libpython_stp_debug} -%endif # Analog of the -devel subpackage's files: %{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu} diff --git a/systemtap-example.stp b/systemtap-example.stp deleted file mode 100644 index 164333a..0000000 --- a/systemtap-example.stp +++ /dev/null @@ -1,19 +0,0 @@ -/* - Example usage of the Python systemtap tapset to show a nested view of all - Python function calls (and returns) across the whole system. - - Run this using - stap systemtap-example.stp - to instrument all Python processes on the system, or (for example) using - stap systemtap-example.stp -c COMMAND - to instrument a specific program (implemented in Python) -*/ -probe python.function.entry -{ - printf("%s => %s in %s:%d\n", thread_indent(1), funcname, filename, lineno); -} - -probe python.function.return -{ - printf("%s <= %s in %s:%d\n", thread_indent(-1), funcname, filename, lineno); -} From 6f9a91b6423b66131d58620352c249595922ad3e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 29 Nov 2017 16:32:41 +0100 Subject: [PATCH 17/67] Remove python-gdb.py source file as it now gets installed from the upstream sources --- python-gdb.py | 1380 ------------------------------------------------- 1 file changed, 1380 deletions(-) delete mode 100644 python-gdb.py diff --git a/python-gdb.py b/python-gdb.py deleted file mode 100644 index dd6d462..0000000 --- a/python-gdb.py +++ /dev/null @@ -1,1380 +0,0 @@ -#!/usr/bin/python -''' -From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb -to be extended with Python code e.g. for library-specific data visualizations, -such as for the C++ STL types. Documentation on this API can be seen at: -http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html - - -This python module deals with the case when the process being debugged (the -"inferior process" in gdb parlance) is itself python, or more specifically, -linked against libpython. In this situation, almost every item of data is a -(PyObject*), and having the debugger merely print their addresses is not very -enlightening. - -This module embeds knowledge about the implementation details of libpython so -that we can emit useful visualizations e.g. a string, a list, a dict, a frame -giving file/line information and the state of local variables - -In particular, given a gdb.Value corresponding to a PyObject* in the inferior -process, we can generate a "proxy value" within the gdb process. For example, -given a PyObject* in the inferior process that is in fact a PyListObject* -holding three PyObject* that turn out to be PyBytesObject* instances, we can -generate a proxy value within the gdb process that is a list of bytes -instances: - [b"foo", b"bar", b"baz"] - -Doing so can be expensive for complicated graphs of objects, and could take -some time, so we also have a "write_repr" method that writes a representation -of the data to a file-like object. This allows us to stop the traversal by -having the file-like object raise an exception if it gets too much data. - -With both "proxyval" and "write_repr" we keep track of the set of all addresses -visited so far in the traversal, to avoid infinite recursion due to cycles in -the graph of object references. - -We try to defer gdb.lookup_type() invocations for python types until as late as -possible: for a dynamically linked python binary, when the process starts in -the debugger, the libpython.so hasn't been dynamically loaded yet, so none of -the type names are known to the debugger - -The module also extends gdb with some python-specific commands. -''' -from __future__ import with_statement -import gdb - -# Look up the gdb.Type for some standard types: -_type_char_ptr = gdb.lookup_type('char').pointer() # char* -_type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned char* -_type_void_ptr = gdb.lookup_type('void').pointer() # void* -_type_size_t = gdb.lookup_type('size_t') - -SIZEOF_VOID_P = _type_void_ptr.sizeof - - -Py_TPFLAGS_HEAPTYPE = (1L << 9) - -Py_TPFLAGS_INT_SUBCLASS = (1L << 23) -Py_TPFLAGS_LONG_SUBCLASS = (1L << 24) -Py_TPFLAGS_LIST_SUBCLASS = (1L << 25) -Py_TPFLAGS_TUPLE_SUBCLASS = (1L << 26) -Py_TPFLAGS_BYTES_SUBCLASS = (1L << 27) -Py_TPFLAGS_UNICODE_SUBCLASS = (1L << 28) -Py_TPFLAGS_DICT_SUBCLASS = (1L << 29) -Py_TPFLAGS_BASE_EXC_SUBCLASS = (1L << 30) -Py_TPFLAGS_TYPE_SUBCLASS = (1L << 31) - - -MAX_OUTPUT_LEN=1024 - -class NullPyObjectPtr(RuntimeError): - pass - - -def safety_limit(val): - # Given a integer value from the process being debugged, limit it to some - # safety threshold so that arbitrary breakage within said process doesn't - # break the gdb process too much (e.g. sizes of iterations, sizes of lists) - return min(val, 1000) - - -def safe_range(val): - # As per range, but don't trust the value too much: cap it to a safety - # threshold in case the data was corrupted - return xrange(safety_limit(val)) - - -class StringTruncated(RuntimeError): - pass - -class TruncatedStringIO(object): - '''Similar to cStringIO, but can truncate the output by raising a - StringTruncated exception''' - def __init__(self, maxlen=None): - self._val = '' - self.maxlen = maxlen - - def write(self, data): - if self.maxlen: - if len(data) + len(self._val) > self.maxlen: - # Truncation: - self._val += data[0:self.maxlen - len(self._val)] - raise StringTruncated() - - self._val += data - - def getvalue(self): - return self._val - -class PyObjectPtr(object): - """ - Class wrapping a gdb.Value that's a either a (PyObject*) within the - inferior process, or some subclass pointer e.g. (PyBytesObject*) - - There will be a subclass for every refined PyObject type that we care - about. - - Note that at every stage the underlying pointer could be NULL, point - to corrupt data, etc; this is the debugger, after all. - """ - _typename = 'PyObject' - - def __init__(self, gdbval, cast_to=None): - if cast_to: - self._gdbval = gdbval.cast(cast_to) - else: - self._gdbval = gdbval - - def field(self, name): - ''' - Get the gdb.Value for the given field within the PyObject, coping with - some python 2 versus python 3 differences. - - Various libpython types are defined using the "PyObject_HEAD" and - "PyObject_VAR_HEAD" macros. - - In Python 2, this these are defined so that "ob_type" and (for a var - object) "ob_size" are fields of the type in question. - - In Python 3, this is defined as an embedded PyVarObject type thus: - PyVarObject ob_base; - so that the "ob_size" field is located insize the "ob_base" field, and - the "ob_type" is most easily accessed by casting back to a (PyObject*). - ''' - if self.is_null(): - raise NullPyObjectPtr(self) - - if name == 'ob_type': - pyo_ptr = self._gdbval.cast(PyObjectPtr.get_gdb_type()) - return pyo_ptr.dereference()[name] - - if name == 'ob_size': - pyo_ptr = self._gdbval.cast(PyVarObjectPtr.get_gdb_type()) - return pyo_ptr.dereference()[name] - - # General case: look it up inside the object: - return self._gdbval.dereference()[name] - - def pyop_field(self, name): - ''' - Get a PyObjectPtr for the given PyObject* field within this PyObject, - coping with some python 2 versus python 3 differences. - ''' - return PyObjectPtr.from_pyobject_ptr(self.field(name)) - - def write_field_repr(self, name, out, visited): - ''' - Extract the PyObject* field named "name", and write its representation - to file-like object "out" - ''' - field_obj = self.pyop_field(name) - field_obj.write_repr(out, visited) - - def get_truncated_repr(self, maxlen): - ''' - Get a repr-like string for the data, but truncate it at "maxlen" bytes - (ending the object graph traversal as soon as you do) - ''' - out = TruncatedStringIO(maxlen) - try: - self.write_repr(out, set()) - except StringTruncated: - # Truncation occurred: - return out.getvalue() + '...(truncated)' - - # No truncation occurred: - return out.getvalue() - - def type(self): - return PyTypeObjectPtr(self.field('ob_type')) - - def is_null(self): - return 0 == long(self._gdbval) - - def is_optimized_out(self): - ''' - Is the value of the underlying PyObject* visible to the debugger? - - This can vary with the precise version of the compiler used to build - Python, and the precise version of gdb. - - See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=556975 with - PyEval_EvalFrameEx's "f" - ''' - return self._gdbval.is_optimized_out - - def safe_tp_name(self): - try: - return self.type().field('tp_name').string() - except NullPyObjectPtr: - # NULL tp_name? - return 'unknown' - except RuntimeError: - # Can't even read the object at all? - return 'unknown' - - def proxyval(self, visited): - ''' - Scrape a value from the inferior process, and try to represent it - within the gdb process, whilst (hopefully) avoiding crashes when - the remote data is corrupt. - - Derived classes will override this. - - For example, a PyIntObject* with ob_ival 42 in the inferior process - should result in an int(42) in this process. - - visited: a set of all gdb.Value pyobject pointers already visited - whilst generating this value (to guard against infinite recursion when - visiting object graphs with loops). Analogous to Py_ReprEnter and - Py_ReprLeave - ''' - - class FakeRepr(object): - """ - Class representing a non-descript PyObject* value in the inferior - process for when we don't have a custom scraper, intended to have - a sane repr(). - """ - - def __init__(self, tp_name, address): - self.tp_name = tp_name - self.address = address - - def __repr__(self): - # For the NULL pointer, we have no way of knowing a type, so - # special-case it as per - # http://bugs.python.org/issue8032#msg100882 - if self.address == 0: - return '0x0' - return '<%s at remote 0x%x>' % (self.tp_name, self.address) - - return FakeRepr(self.safe_tp_name(), - long(self._gdbval)) - - def write_repr(self, out, visited): - ''' - Write a string representation of the value scraped from the inferior - process to "out", a file-like object. - ''' - # Default implementation: generate a proxy value and write its repr - # However, this could involve a lot of work for complicated objects, - # so for derived classes we specialize this - return out.write(repr(self.proxyval(visited))) - - @classmethod - def subclass_from_type(cls, t): - ''' - Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a - (PyTypeObject*), determine the corresponding subclass of PyObjectPtr - to use - - Ideally, we would look up the symbols for the global types, but that - isn't working yet: - (gdb) python print gdb.lookup_symbol('PyList_Type')[0].value - Traceback (most recent call last): - File "", line 1, in - NotImplementedError: Symbol type not yet supported in Python scripts. - Error while executing Python code. - - For now, we use tp_flags, after doing some string comparisons on the - tp_name for some special-cases that don't seem to be visible through - flags - ''' - try: - tp_name = t.field('tp_name').string() - tp_flags = int(t.field('tp_flags')) - except RuntimeError: - # Handle any kind of error e.g. NULL ptrs by simply using the base - # class - return cls - - #print 'tp_flags = 0x%08x' % tp_flags - #print 'tp_name = %r' % tp_name - - name_map = {'bool': PyBoolObjectPtr, - 'classobj': PyClassObjectPtr, - 'instance': PyInstanceObjectPtr, - 'NoneType': PyNoneStructPtr, - 'frame': PyFrameObjectPtr, - 'set' : PySetObjectPtr, - 'frozenset' : PySetObjectPtr, - 'builtin_function_or_method' : PyCFunctionObjectPtr, - } - if tp_name in name_map: - return name_map[tp_name] - - if tp_flags & Py_TPFLAGS_HEAPTYPE: - return HeapTypeObjectPtr - - if tp_flags & Py_TPFLAGS_INT_SUBCLASS: - return PyIntObjectPtr - if tp_flags & Py_TPFLAGS_LONG_SUBCLASS: - return PyLongObjectPtr - if tp_flags & Py_TPFLAGS_LIST_SUBCLASS: - return PyListObjectPtr - if tp_flags & Py_TPFLAGS_TUPLE_SUBCLASS: - return PyTupleObjectPtr - if tp_flags & Py_TPFLAGS_BYTES_SUBCLASS: - return PyBytesObjectPtr - if tp_flags & Py_TPFLAGS_UNICODE_SUBCLASS: - return PyUnicodeObjectPtr - if tp_flags & Py_TPFLAGS_DICT_SUBCLASS: - return PyDictObjectPtr - if tp_flags & Py_TPFLAGS_BASE_EXC_SUBCLASS: - return PyBaseExceptionObjectPtr - #if tp_flags & Py_TPFLAGS_TYPE_SUBCLASS: - # return PyTypeObjectPtr - - # Use the base class: - return cls - - @classmethod - def from_pyobject_ptr(cls, gdbval): - ''' - Try to locate the appropriate derived class dynamically, and cast - the pointer accordingly. - ''' - try: - p = PyObjectPtr(gdbval) - cls = cls.subclass_from_type(p.type()) - return cls(gdbval, cast_to=cls.get_gdb_type()) - except RuntimeError: - # Handle any kind of error e.g. NULL ptrs by simply using the base - # class - pass - return cls(gdbval) - - @classmethod - def get_gdb_type(cls): - return gdb.lookup_type(cls._typename).pointer() - - def as_address(self): - return long(self._gdbval) - -class PyVarObjectPtr(PyObjectPtr): - _typename = 'PyVarObject' - -class ProxyAlreadyVisited(object): - ''' - Placeholder proxy to use when protecting against infinite recursion due to - loops in the object graph. - - Analogous to the values emitted by the users of Py_ReprEnter and Py_ReprLeave - ''' - def __init__(self, rep): - self._rep = rep - - def __repr__(self): - return self._rep - - -def _write_instance_repr(out, visited, name, pyop_attrdict, address): - '''Shared code for use by old-style and new-style classes: - write a representation to file-like object "out"''' - out.write('<') - out.write(name) - - # Write dictionary of instance attributes: - if isinstance(pyop_attrdict, PyDictObjectPtr): - out.write('(') - first = True - for pyop_arg, pyop_val in pyop_attrdict.iteritems(): - if not first: - out.write(', ') - first = False - out.write(pyop_arg.proxyval(visited)) - out.write('=') - pyop_val.write_repr(out, visited) - out.write(')') - out.write(' at remote 0x%x>' % address) - - -class InstanceProxy(object): - - def __init__(self, cl_name, attrdict, address): - self.cl_name = cl_name - self.attrdict = attrdict - self.address = address - - def __repr__(self): - if isinstance(self.attrdict, dict): - kwargs = ', '.join(["%s=%r" % (arg, val) - for arg, val in self.attrdict.iteritems()]) - return '<%s(%s) at remote 0x%x>' % (self.cl_name, - kwargs, self.address) - else: - return '<%s at remote 0x%x>' % (self.cl_name, - self.address) - -def _PyObject_VAR_SIZE(typeobj, nitems): - return ( ( typeobj.field('tp_basicsize') + - nitems * typeobj.field('tp_itemsize') + - (SIZEOF_VOID_P - 1) - ) & ~(SIZEOF_VOID_P - 1) - ).cast(_type_size_t) - -class HeapTypeObjectPtr(PyObjectPtr): - _typename = 'PyObject' - - def get_attr_dict(self): - ''' - Get the PyDictObject ptr representing the attribute dictionary - (or None if there's a problem) - ''' - try: - typeobj = self.type() - dictoffset = int_from_int(typeobj.field('tp_dictoffset')) - if dictoffset != 0: - if dictoffset < 0: - type_PyVarObject_ptr = gdb.lookup_type('PyVarObject').pointer() - tsize = int_from_int(self._gdbval.cast(type_PyVarObject_ptr)['ob_size']) - if tsize < 0: - tsize = -tsize - size = _PyObject_VAR_SIZE(typeobj, tsize) - dictoffset += size - assert dictoffset > 0 - assert dictoffset % SIZEOF_VOID_P == 0 - - dictptr = self._gdbval.cast(_type_char_ptr) + dictoffset - PyObjectPtrPtr = PyObjectPtr.get_gdb_type().pointer() - dictptr = dictptr.cast(PyObjectPtrPtr) - return PyObjectPtr.from_pyobject_ptr(dictptr.dereference()) - except RuntimeError: - # Corrupt data somewhere; fail safe - pass - - # Not found, or some kind of error: - return None - - def proxyval(self, visited): - ''' - Support for new-style classes. - - Currently we just locate the dictionary using a transliteration to - python of _PyObject_GetDictPtr, ignoring descriptors - ''' - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('<...>') - visited.add(self.as_address()) - - pyop_attr_dict = self.get_attr_dict() - if pyop_attr_dict: - attr_dict = pyop_attr_dict.proxyval(visited) - else: - attr_dict = {} - tp_name = self.safe_tp_name() - - # New-style class: - return InstanceProxy(tp_name, attr_dict, long(self._gdbval)) - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('<...>') - return - visited.add(self.as_address()) - - pyop_attrdict = self.get_attr_dict() - _write_instance_repr(out, visited, - self.safe_tp_name(), pyop_attrdict, self.as_address()) - -class ProxyException(Exception): - def __init__(self, tp_name, args): - self.tp_name = tp_name - self.args = args - - def __repr__(self): - return '%s%r' % (self.tp_name, self.args) - -class PyBaseExceptionObjectPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyBaseExceptionObject* i.e. an exception - within the process being debugged. - """ - _typename = 'PyBaseExceptionObject' - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('(...)') - visited.add(self.as_address()) - arg_proxy = self.pyop_field('args').proxyval(visited) - return ProxyException(self.safe_tp_name(), - arg_proxy) - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('(...)') - return - visited.add(self.as_address()) - - out.write(self.safe_tp_name()) - self.write_field_repr('args', out, visited) - -class PyClassObjectPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyClassObject* i.e. a - instance within the process being debugged. - """ - _typename = 'PyClassObject' - - -class BuiltInFunctionProxy(object): - def __init__(self, ml_name): - self.ml_name = ml_name - - def __repr__(self): - return "" % self.ml_name - -class BuiltInMethodProxy(object): - def __init__(self, ml_name, pyop_m_self): - self.ml_name = ml_name - self.pyop_m_self = pyop_m_self - - def __repr__(self): - return ('' - % (self.ml_name, - self.pyop_m_self.safe_tp_name(), - self.pyop_m_self.as_address()) - ) - -class PyCFunctionObjectPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyCFunctionObject* - (see Include/methodobject.h and Objects/methodobject.c) - """ - _typename = 'PyCFunctionObject' - - def proxyval(self, visited): - m_ml = self.field('m_ml') # m_ml is a (PyMethodDef*) - ml_name = m_ml['ml_name'].string() - - pyop_m_self = self.pyop_field('m_self') - if pyop_m_self.is_null(): - return BuiltInFunctionProxy(ml_name) - else: - return BuiltInMethodProxy(ml_name, pyop_m_self) - - -class PyCodeObjectPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyCodeObject* i.e. a instance - within the process being debugged. - """ - _typename = 'PyCodeObject' - - def addr2line(self, addrq): - ''' - Get the line number for a given bytecode offset - - Analogous to PyCode_Addr2Line; translated from pseudocode in - Objects/lnotab_notes.txt - ''' - co_lnotab = self.pyop_field('co_lnotab').proxyval(set()) - - # Initialize lineno to co_firstlineno as per PyCode_Addr2Line - # not 0, as lnotab_notes.txt has it: - lineno = int_from_int(self.field('co_firstlineno')) - - addr = 0 - for addr_incr, line_incr in zip(co_lnotab[::2], co_lnotab[1::2]): - addr += ord(addr_incr) - if addr > addrq: - return lineno - lineno += ord(line_incr) - return lineno - - -class PyDictObjectPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyDictObject* i.e. a dict instance - within the process being debugged. - """ - _typename = 'PyDictObject' - - def iteritems(self): - ''' - Yields a sequence of (PyObjectPtr key, PyObjectPtr value) pairs, - analagous to dict.iteritems() - ''' - for i in safe_range(self.field('ma_mask') + 1): - ep = self.field('ma_table') + i - pyop_value = PyObjectPtr.from_pyobject_ptr(ep['me_value']) - if not pyop_value.is_null(): - pyop_key = PyObjectPtr.from_pyobject_ptr(ep['me_key']) - yield (pyop_key, pyop_value) - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('{...}') - visited.add(self.as_address()) - - result = {} - for pyop_key, pyop_value in self.iteritems(): - proxy_key = pyop_key.proxyval(visited) - proxy_value = pyop_value.proxyval(visited) - result[proxy_key] = proxy_value - return result - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('{...}') - return - visited.add(self.as_address()) - - out.write('{') - first = True - for pyop_key, pyop_value in self.iteritems(): - if not first: - out.write(', ') - first = False - pyop_key.write_repr(out, visited) - out.write(': ') - pyop_value.write_repr(out, visited) - out.write('}') - -class PyInstanceObjectPtr(PyObjectPtr): - _typename = 'PyInstanceObject' - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('<...>') - visited.add(self.as_address()) - - # Get name of class: - in_class = self.pyop_field('in_class') - cl_name = in_class.pyop_field('cl_name').proxyval(visited) - - # Get dictionary of instance attributes: - in_dict = self.pyop_field('in_dict').proxyval(visited) - - # Old-style class: - return InstanceProxy(cl_name, in_dict, long(self._gdbval)) - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('<...>') - return - visited.add(self.as_address()) - - # Old-style class: - - # Get name of class: - in_class = self.pyop_field('in_class') - cl_name = in_class.pyop_field('cl_name').proxyval(visited) - - # Get dictionary of instance attributes: - pyop_in_dict = self.pyop_field('in_dict') - - _write_instance_repr(out, visited, - cl_name, pyop_in_dict, self.as_address()) - -class PyListObjectPtr(PyObjectPtr): - _typename = 'PyListObject' - - def __getitem__(self, i): - # Get the gdb.Value for the (PyObject*) with the given index: - field_ob_item = self.field('ob_item') - return field_ob_item[i] - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('[...]') - visited.add(self.as_address()) - - result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited) - for i in safe_range(int_from_int(self.field('ob_size')))] - return result - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('[...]') - return - visited.add(self.as_address()) - - out.write('[') - for i in safe_range(int_from_int(self.field('ob_size'))): - if i > 0: - out.write(', ') - element = PyObjectPtr.from_pyobject_ptr(self[i]) - element.write_repr(out, visited) - out.write(']') - -class PyLongObjectPtr(PyObjectPtr): - _typename = 'PyLongObject' - - def proxyval(self, visited): - ''' - Python's Include/longobjrep.h has this declaration: - struct _longobject { - PyObject_VAR_HEAD - digit ob_digit[1]; - }; - - with this description: - The absolute value of a number is equal to - SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) - Negative numbers are represented with ob_size < 0; - zero is represented by ob_size == 0. - - where SHIFT can be either: - #define PyLong_SHIFT 30 - #define PyLong_SHIFT 15 - ''' - ob_size = long(self.field('ob_size')) - if ob_size == 0: - return 0L - - ob_digit = self.field('ob_digit') - - if gdb.lookup_type('digit').sizeof == 2: - SHIFT = 15L - else: - SHIFT = 30L - - digits = [long(ob_digit[i]) * 2**(SHIFT*i) - for i in safe_range(abs(ob_size))] - result = sum(digits) - if ob_size < 0: - result = -result - return result - -class PyBoolObjectPtr(PyLongObjectPtr): - """ - Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two - instances (Py_True/Py_False) within the process being debugged. - """ - def proxyval(self, visited): - if PyLongObjectPtr.proxyval(self, visited): - return True - else: - return False - -class PyNoneStructPtr(PyObjectPtr): - """ - Class wrapping a gdb.Value that's a PyObject* pointing to the - singleton (we hope) _Py_NoneStruct with ob_type PyNone_Type - """ - _typename = 'PyObject' - - def proxyval(self, visited): - return None - - -class PyFrameObjectPtr(PyObjectPtr): - _typename = 'PyFrameObject' - - def __init__(self, gdbval, cast_to): - PyObjectPtr.__init__(self, gdbval, cast_to) - - if not self.is_optimized_out(): - self.co = PyCodeObjectPtr.from_pyobject_ptr(self.field('f_code')) - self.co_name = self.co.pyop_field('co_name') - self.co_filename = self.co.pyop_field('co_filename') - - self.f_lineno = int_from_int(self.field('f_lineno')) - self.f_lasti = int_from_int(self.field('f_lasti')) - self.co_nlocals = int_from_int(self.co.field('co_nlocals')) - self.co_varnames = PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames')) - - def iter_locals(self): - ''' - Yield a sequence of (name,value) pairs of PyObjectPtr instances, for - the local variables of this frame - ''' - if self.is_optimized_out(): - return - - f_localsplus = self.field('f_localsplus') - for i in safe_range(self.co_nlocals): - pyop_value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i]) - if not pyop_value.is_null(): - pyop_name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i]) - yield (pyop_name, pyop_value) - - def iter_globals(self): - ''' - Yield a sequence of (name,value) pairs of PyObjectPtr instances, for - the global variables of this frame - ''' - if self.is_optimized_out(): - return - - pyop_globals = self.pyop_field('f_globals') - return pyop_globals.iteritems() - - def iter_builtins(self): - ''' - Yield a sequence of (name,value) pairs of PyObjectPtr instances, for - the builtin variables - ''' - if self.is_optimized_out(): - return - - pyop_builtins = self.pyop_field('f_builtins') - return pyop_builtins.iteritems() - - def get_var_by_name(self, name): - ''' - Look for the named local variable, returning a (PyObjectPtr, scope) pair - where scope is a string 'local', 'global', 'builtin' - - If not found, return (None, None) - ''' - for pyop_name, pyop_value in self.iter_locals(): - if name == pyop_name.proxyval(set()): - return pyop_value, 'local' - for pyop_name, pyop_value in self.iter_globals(): - if name == pyop_name.proxyval(set()): - return pyop_value, 'global' - for pyop_name, pyop_value in self.iter_builtins(): - if name == pyop_name.proxyval(set()): - return pyop_value, 'builtin' - return None, None - - def filename(self): - '''Get the path of the current Python source file, as a string''' - if self.is_optimized_out(): - return '(frame information optimized out)' - return self.co_filename.proxyval(set()) - - def current_line_num(self): - '''Get current line number as an integer (1-based) - - Translated from PyFrame_GetLineNumber and PyCode_Addr2Line - - See Objects/lnotab_notes.txt - ''' - if self.is_optimized_out(): - return None - f_trace = self.field('f_trace') - if long(f_trace) != 0: - # we have a non-NULL f_trace: - return self.f_lineno - else: - #try: - return self.co.addr2line(self.f_lasti) - #except ValueError: - # return self.f_lineno - - def current_line(self): - '''Get the text of the current source line as a string, with a trailing - newline character''' - if self.is_optimized_out(): - return '(frame information optimized out)' - with open(self.filename(), 'r') as f: - all_lines = f.readlines() - # Convert from 1-based current_line_num to 0-based list offset: - return all_lines[self.current_line_num()-1] - - def write_repr(self, out, visited): - if self.is_optimized_out(): - out.write('(frame information optimized out)') - return - out.write('Frame 0x%x, for file %s, line %i, in %s (' - % (self.as_address(), - self.co_filename.proxyval(visited), - self.current_line_num(), - self.co_name.proxyval(visited))) - first = True - for pyop_name, pyop_value in self.iter_locals(): - if not first: - out.write(', ') - first = False - - out.write(pyop_name.proxyval(visited)) - out.write('=') - pyop_value.write_repr(out, visited) - - out.write(')') - -class PySetObjectPtr(PyObjectPtr): - _typename = 'PySetObject' - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('%s(...)' % self.safe_tp_name()) - visited.add(self.as_address()) - - members = [] - table = self.field('table') - for i in safe_range(self.field('mask')+1): - setentry = table[i] - key = setentry['key'] - if key != 0: - key_proxy = PyObjectPtr.from_pyobject_ptr(key).proxyval(visited) - if key_proxy != '': - members.append(key_proxy) - if self.safe_tp_name() == 'frozenset': - return frozenset(members) - else: - return set(members) - - def write_repr(self, out, visited): - out.write(self.safe_tp_name()) - - # Guard against infinite loops: - if self.as_address() in visited: - out.write('(...)') - return - visited.add(self.as_address()) - - out.write('([') - first = True - table = self.field('table') - for i in safe_range(self.field('mask')+1): - setentry = table[i] - key = setentry['key'] - if key != 0: - pyop_key = PyObjectPtr.from_pyobject_ptr(key) - key_proxy = pyop_key.proxyval(visited) # FIXME! - if key_proxy != '': - if not first: - out.write(', ') - first = False - pyop_key.write_repr(out, visited) - out.write('])') - - -class PyBytesObjectPtr(PyObjectPtr): - _typename = 'PyBytesObject' - - def __str__(self): - field_ob_size = self.field('ob_size') - field_ob_sval = self.field('ob_sval') - char_ptr = field_ob_sval.address.cast(_type_unsigned_char_ptr) - return ''.join([chr(char_ptr[i]) for i in safe_range(field_ob_size)]) - - def proxyval(self, visited): - return str(self) - -class PyTupleObjectPtr(PyObjectPtr): - _typename = 'PyTupleObject' - - def __getitem__(self, i): - # Get the gdb.Value for the (PyObject*) with the given index: - field_ob_item = self.field('ob_item') - return field_ob_item[i] - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('(...)') - visited.add(self.as_address()) - - result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited) - for i in safe_range(int_from_int(self.field('ob_size')))]) - return result - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('(...)') - return - visited.add(self.as_address()) - - out.write('(') - for i in safe_range(int_from_int(self.field('ob_size'))): - if i > 0: - out.write(', ') - element = PyObjectPtr.from_pyobject_ptr(self[i]) - element.write_repr(out, visited) - if self.field('ob_size') == 1: - out.write(',)') - else: - out.write(')') - -class PyTypeObjectPtr(PyObjectPtr): - _typename = 'PyTypeObject' - - -class PyUnicodeObjectPtr(PyObjectPtr): - _typename = 'PyUnicodeObject' - - def proxyval(self, visited): - # From unicodeobject.h: - # Py_ssize_t length; /* Length of raw Unicode data in buffer */ - # Py_UNICODE *str; /* Raw Unicode buffer */ - field_length = long(self.field('length')) - field_str = self.field('str') - - # Gather a list of ints from the Py_UNICODE array; these are either - # UCS-2 or UCS-4 code points: - Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)] - - # Convert the int code points to unicode characters, and generate a - # local unicode instance: - result = u''.join([unichr(ucs) for ucs in Py_UNICODEs]) - return result - - -def int_from_int(gdbval): - return int(str(gdbval)) - - -def stringify(val): - # TODO: repr() puts everything on one line; pformat can be nicer, but - # can lead to v.long results; this function isolates the choice - if True: - return repr(val) - else: - from pprint import pformat - return pformat(val) - - -class PyObjectPtrPrinter: - "Prints a (PyObject*)" - - def __init__ (self, gdbval): - self.gdbval = gdbval - - def to_string (self): - pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval) - if True: - return pyop.get_truncated_repr(MAX_OUTPUT_LEN) - else: - # Generate full proxy value then stringify it. - # Doing so could be expensive - proxyval = pyop.proxyval(set()) - return stringify(proxyval) - -def pretty_printer_lookup(gdbval): - type = gdbval.type.unqualified() - if type.code == gdb.TYPE_CODE_PTR: - type = type.target().unqualified() - t = str(type) - if t in ("PyObject", "PyFrameObject", "PyUnicodeObject"): - return PyObjectPtrPrinter(gdbval) - -""" -During development, I've been manually invoking the code in this way: -(gdb) python - -import sys -sys.path.append('/home/david/coding/python-gdb') -import libpython -end - -then reloading it after each edit like this: -(gdb) python reload(libpython) - -The following code should ensure that the prettyprinter is registered -if the code is autoloaded by gdb when visiting libpython.so, provided -that this python file is installed to the same path as the library (or its -.debug file) plus a "-gdb.py" suffix, e.g: - /usr/lib/libpython2.6.so.1.0-gdb.py - /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py -""" -def register (obj): - if obj == None: - obj = gdb - - # Wire up the pretty-printer - obj.pretty_printers.append(pretty_printer_lookup) - -register (gdb.current_objfile ()) - - -class Frame(object): - ''' - Wrapper for gdb.Frame, adding various methods - ''' - def __init__(self, gdbframe): - self._gdbframe = gdbframe - - def older(self): - older = self._gdbframe.older() - if older: - return Frame(older) - else: - return None - - def newer(self): - newer = self._gdbframe.newer() - if newer: - return Frame(newer) - else: - return None - - def select(self): - self._gdbframe.select() - - def get_index(self): - '''Calculate index of frame, starting at 0 for the newest frame within - this thread''' - index = 0 - # Go down until you reach the newest frame: - iter_frame = self - while iter_frame.newer(): - index += 1 - iter_frame = iter_frame.newer() - return index - - def is_evalframeex(self): - if self._gdbframe.function(): - if self._gdbframe.function().name == 'PyEval_EvalFrameEx': - ''' - I believe we also need to filter on the inline - struct frame_id.inline_depth, only regarding frames with - an inline depth of 0 as actually being this function - - So we reject those with type gdb.INLINE_FRAME - ''' - if self._gdbframe.type() == gdb.NORMAL_FRAME: - # We have a PyEval_EvalFrameEx frame: - return True - - return False - - def get_pyop(self): - try: - f = self._gdbframe.read_var('f') - return PyFrameObjectPtr.from_pyobject_ptr(f) - except ValueError: - return None - - @classmethod - def get_selected_frame(cls): - _gdbframe = gdb.selected_frame() - if _gdbframe: - return Frame(_gdbframe) - return None - - @classmethod - def get_selected_python_frame(cls): - '''Try to obtain the Frame for the python code in the selected frame, - or None''' - frame = cls.get_selected_frame() - - while frame: - if frame.is_evalframeex(): - return frame - frame = frame.older() - - # Not found: - return None - - def print_summary(self): - if self.is_evalframeex(): - pyop = self.get_pyop() - if pyop: - sys.stdout.write('#%i %s\n' % (self.get_index(), pyop.get_truncated_repr(MAX_OUTPUT_LEN))) - sys.stdout.write(pyop.current_line()) - else: - sys.stdout.write('#%i (unable to read python frame information)\n' % self.get_index()) - else: - sys.stdout.write('#%i\n' % self.get_index()) - -class PyList(gdb.Command): - '''List the current Python source code, if any - - Use - py-list START - to list at a different line number within the python source. - - Use - py-list START, END - to list a specific range of lines within the python source. - ''' - - def __init__(self): - gdb.Command.__init__ (self, - "py-list", - gdb.COMMAND_FILES, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - import re - - start = None - end = None - - m = re.match(r'\s*(\d+)\s*', args) - if m: - start = int(m.group(0)) - end = start + 10 - - m = re.match(r'\s*(\d+)\s*,\s*(\d+)\s*', args) - if m: - start, end = map(int, m.groups()) - - frame = Frame.get_selected_python_frame() - if not frame: - print 'Unable to locate python frame' - return - - pyop = frame.get_pyop() - if not pyop: - print 'Unable to read information on python frame' - return - - filename = pyop.filename() - lineno = pyop.current_line_num() - - if start is None: - start = lineno - 5 - end = lineno + 5 - - if start<1: - start = 1 - - with open(filename, 'r') as f: - all_lines = f.readlines() - # start and end are 1-based, all_lines is 0-based; - # so [start-1:end] as a python slice gives us [start, end] as a - # closed interval - for i, line in enumerate(all_lines[start-1:end]): - linestr = str(i+start) - # Highlight current line: - if i + start == lineno: - linestr = '>' + linestr - sys.stdout.write('%4s %s' % (linestr, line)) - - -# ...and register the command: -PyList() - -def move_in_stack(move_up): - '''Move up or down the stack (for the py-up/py-down command)''' - frame = Frame.get_selected_python_frame() - while frame: - if move_up: - iter_frame = frame.older() - else: - iter_frame = frame.newer() - - if not iter_frame: - break - - if iter_frame.is_evalframeex(): - # Result: - iter_frame.select() - iter_frame.print_summary() - return - - frame = iter_frame - - if move_up: - print 'Unable to find an older python frame' - else: - print 'Unable to find a newer python frame' - -class PyUp(gdb.Command): - 'Select and print the python stack frame that called this one (if any)' - def __init__(self): - gdb.Command.__init__ (self, - "py-up", - gdb.COMMAND_STACK, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - move_in_stack(move_up=True) - -PyUp() - -class PyDown(gdb.Command): - 'Select and print the python stack frame called by this one (if any)' - def __init__(self): - gdb.Command.__init__ (self, - "py-down", - gdb.COMMAND_STACK, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - move_in_stack(move_up=False) - -PyDown() - -class PyBacktrace(gdb.Command): - 'Display the current python frame and all the frames within its call stack (if any)' - def __init__(self): - gdb.Command.__init__ (self, - "py-bt", - gdb.COMMAND_STACK, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - frame = Frame.get_selected_python_frame() - while frame: - if frame.is_evalframeex(): - frame.print_summary() - frame = frame.older() - -PyBacktrace() - -class PyPrint(gdb.Command): - 'Look up the given python variable name, and print it' - def __init__(self): - gdb.Command.__init__ (self, - "py-print", - gdb.COMMAND_DATA, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - name = str(args) - - frame = Frame.get_selected_python_frame() - if not frame: - print 'Unable to locate python frame' - return - - pyop_frame = frame.get_pyop() - if not pyop_frame: - print 'Unable to read information on python frame' - return - - pyop_var, scope = pyop_frame.get_var_by_name(name) - - if pyop_var: - print ('%s %r = %s' - % (scope, - name, - pyop_var.get_truncated_repr(MAX_OUTPUT_LEN))) - else: - print '%r not found' % name - -PyPrint() - -class PyLocals(gdb.Command): - 'Look up the given python variable name, and print it' - def __init__(self): - gdb.Command.__init__ (self, - "py-locals", - gdb.COMMAND_DATA, - gdb.COMPLETE_NONE) - - - def invoke(self, args, from_tty): - name = str(args) - - frame = Frame.get_selected_python_frame() - if not frame: - print 'Unable to locate python frame' - return - - pyop_frame = frame.get_pyop() - if not pyop_frame: - print 'Unable to read information on python frame' - return - - for pyop_name, pyop_value in pyop_frame.iter_locals(): - print ('%s = %s' - % (pyop_name.proxyval(set()), - pyop_value.get_truncated_repr(MAX_OUTPUT_LEN))) - -PyLocals() From 3dcb34959e11920c4141e25f38a1ee73169b534b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 29 Nov 2017 16:46:46 +0100 Subject: [PATCH 18/67] Masc two macros in comments that were expanded. Remove the commented out file for the time shared library. --- python37.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python37.spec b/python37.spec index 52118c0..c99f34a 100644 --- a/python37.spec +++ b/python37.spec @@ -269,7 +269,7 @@ Patch1: 00001-rpath.patch # 00102 # # Change the various install paths to use /usr/lib64/ instead or /usr/lib -# Only used when "%{_lib}" == "lib64" +# Only used when "%%{_lib}" == "lib64" # Not yet sent upstream. Patch102: 00102-lib64.patch @@ -1260,7 +1260,6 @@ CheckPython optimized %{dynload_dir}/spwd.%{SOABI_optimized}.so %{dynload_dir}/syslog.%{SOABI_optimized}.so %{dynload_dir}/termios.%{SOABI_optimized}.so -#%{dynload_dir}/time.%{SOABI_optimized}.so %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so %{dynload_dir}/unicodedata.%{SOABI_optimized}.so %{dynload_dir}/_uuid.%{SOABI_optimized}.so @@ -1524,7 +1523,6 @@ CheckPython optimized %{dynload_dir}/spwd.%{SOABI_debug}.so %{dynload_dir}/syslog.%{SOABI_debug}.so %{dynload_dir}/termios.%{SOABI_debug}.so -#%{dynload_dir}/time.%{SOABI_debug}.so %{dynload_dir}/_testmultiphase.%{SOABI_debug}.so %{dynload_dir}/unicodedata.%{SOABI_debug}.so %{dynload_dir}/_uuid.%{SOABI_debug}.so @@ -1564,7 +1562,7 @@ CheckPython optimized # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig # See https://bugzilla.redhat.com/show_bug.cgi?id=562980 # -# The /usr/lib/rpm/redhat/macros defines %__debug_package to use +# The /usr/lib/rpm/redhat/macros defines %%__debug_package to use # debugfiles.list, and it appears that everything below /usr/lib/debug and # (/usr/src/debug) gets added to this file (via LISTFILES) in # /usr/lib/rpm/find-debuginfo.sh From 0b33e0cf27cf8edce3d8ff13f1f98718ca83f2fa Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 4 Dec 2017 17:53:50 +0100 Subject: [PATCH 19/67] Remove a ppc64 segfault workaround which provided a larger stack for that arch, as it doesn't seem to affect the build anymore. --- python37.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/python37.spec b/python37.spec index c99f34a..5cc18bc 100644 --- a/python37.spec +++ b/python37.spec @@ -1050,14 +1050,6 @@ done # Running the upstream test suite # ====================================================== -# For ppc64 we need a larger stack than default -# See https://bugzilla.redhat.com/show_bug.cgi?id=1292462 -%ifarch %{power64} - ulimit -a - ulimit -s 16384 -%endif - - topdir=$(pwd) CheckPython() { ConfName=$1 From 13f7a0acb91a9218e45bf88388a48773fc07b338 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 16 Jan 2018 20:36:17 +0100 Subject: [PATCH 20/67] Rebuild for reverted gdbm 1:1.13 on F27 --- python37.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 5cc18bc..4ca9d39 100644 --- a/python37.spec +++ b/python37.spec @@ -194,7 +194,7 @@ BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc-c++ %if %{with gdbm} -BuildRequires: gdbm-devel +BuildRequires: gdbm-devel >= 1:1.13 %endif BuildRequires: glibc-devel BuildRequires: gmp-devel From 60eff5e20777179bc3272a99baf8c2f23595caa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 17 Jan 2018 11:48:11 +0100 Subject: [PATCH 21/67] Require large enough gdbm (fixup for previous commit) --- python37.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python37.spec b/python37.spec index 4ca9d39..bd552d0 100644 --- a/python37.spec +++ b/python37.spec @@ -459,6 +459,11 @@ Obsoletes: python3-enum34 < 1.0.4-5%{?dist} # See https://bugzilla.redhat.com/show_bug.cgi?id=1410644 Requires: glibc%{?_isa} >= 2.24.90-26 +%if %{with gdbm} +# When built with this (as guarded by the BuildRequires above), require it +Requires: gdbm-devel%{?_isa} >= 1:1.13 +%endif + # For backward compatibility only, remove in F29: Provides: system-python-libs = %{version}-%{release} Provides: system-python-libs%{?_isa} = %{version}-%{release} From 8ab3c20b1a6d30636a3c590edf383159439c2f24 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 18 Jan 2018 19:41:19 +0100 Subject: [PATCH 22/67] =?UTF-8?q?R:=20gdbm-devel=20=E2=86=92=20R:=20gdbm?= =?UTF-8?q?=20for=20python3-libs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- python37.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index bd552d0..8681ba0 100644 --- a/python37.spec +++ b/python37.spec @@ -461,7 +461,7 @@ Requires: glibc%{?_isa} >= 2.24.90-26 %if %{with gdbm} # When built with this (as guarded by the BuildRequires above), require it -Requires: gdbm-devel%{?_isa} >= 1:1.13 +Requires: gdbm%{?_isa} >= 1:1.13 %endif # For backward compatibility only, remove in F29: From 212f3d7eb8d9663bd56b2cdfa7067f4e57d83673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 22 Jan 2018 21:10:32 +0100 Subject: [PATCH 23/67] Add patch for libxcrypt --- ...ude-crypt.h-for-declaration-of-crypt.patch | 47 +++++++++++++++++++ python37.spec | 7 +++ 2 files changed, 54 insertions(+) create mode 100644 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch diff --git a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch new file mode 100644 index 0000000..be62939 --- /dev/null +++ b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch @@ -0,0 +1,47 @@ +From 6811089dbf34a2cef9799e1cb6d63b863b58739f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sun, 21 Jan 2018 18:55:31 +0100 +Subject: [PATCH] cryptmodule: Include for declaration of crypt() if + needed + +Not every target system may provide a crypt() function in its stdlibc +and may use an external or replacement library, like libxcrypt, for +providing such functions. +--- + Modules/_cryptmodule.c | 4 ++++ + configure.ac | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c +index 58d179e6a3..bb26d83f55 100644 +--- a/Modules/_cryptmodule.c ++++ b/Modules/_cryptmodule.c +@@ -5,6 +5,10 @@ + + #include + ++#if defined(HAVE_XCRYPT) ++#include ++#endif ++ + /* Module crypt */ + + /*[clinic input] +diff --git a/configure.ac b/configure.ac +index 39e2e8e769..129c198c15 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2816,6 +2816,10 @@ LIBS="$withval $LIBS" + + PKG_PROG_PKG_CONFIG + ++# Check for libxcrypt is present. ++PKG_CHECK_MODULES([libxcrypt], libxcrypt, ++ AC_DEFINE([HAVE_XCRYPT], 1, [Define to 1 if libxcrypt is found.]), []) ++ + # Check for use of the system expat library + AC_MSG_CHECKING(for --with-system-expat) + AC_ARG_WITH(system_expat, +-- +2.16.0 + diff --git a/python37.spec b/python37.spec index 8681ba0..c9b3b12 100644 --- a/python37.spec +++ b/python37.spec @@ -374,6 +374,12 @@ Patch274: 00274-fix-arch-names.patch # Fixed upstream: https://bugs.python.org/issue32521 Patch289: 00289-fix-nis-compilation.patch +# 00290 # +# Not every target system may provide a crypt() function in its stdlibc +# and may use an external or replacement library, like libxcrypt, for +# providing such functions. +Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -676,6 +682,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 %patch289 -p1 +%patch290 -p1 # Remove files that should be generated by the build From 221978fced637390618d95a14b1eb0efa806d0ce Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 23 Jan 2018 13:22:12 +0100 Subject: [PATCH 24/67] Disable strict symbol checks in the link editor. --- python37.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python37.spec b/python37.spec index c9b3b12..a31689d 100644 --- a/python37.spec +++ b/python37.spec @@ -167,6 +167,11 @@ License: Python # on files that test invalid syntax. %undefine py_auto_byte_compile +# Disable strict symbol checks in the link editor. +# See: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af192613e1beec34824a94dc5f6feeeea1568?branch=master +# https://bugzilla.redhat.com/show_bug.cgi?id=1537489 +%undefine _strict_symbol_defs_build + # For multilib support, files that are different between 32- and 64-bit arches # need different filenames. Use "64" or "32" according to the word size. # Currently, the best way to determine an architecture's word size happens to @@ -378,6 +383,7 @@ Patch289: 00289-fix-nis-compilation.patch # Not every target system may provide a crypt() function in its stdlibc # and may use an external or replacement library, like libxcrypt, for # providing such functions. +# Reported upstream: https://bugs.python.org/issue32635 Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch # (New patches go here ^^^) From d3af3ef92c9437fcf73170772d67a8b968bbddb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 23 Jan 2018 15:25:04 +0100 Subject: [PATCH 25/67] Add patch to explicitly link _ctypes module with -ldl (#1537489) Add patch to explicitly link _ctypes module with -ldl (#1537489) Refactored patch for libxcrypt Re-enable strict symbol checks in the link editor --- ...ude-crypt.h-for-declaration-of-crypt.patch | 34 +++++++++---------- ...up-Link-ctypes-against-dl-explicitly.patch | 25 ++++++++++++++ python37.spec | 12 ++++--- 3 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 00291-setup-Link-ctypes-against-dl-explicitly.patch diff --git a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch index be62939..38aa7de 100644 --- a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch +++ b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch @@ -1,4 +1,4 @@ -From 6811089dbf34a2cef9799e1cb6d63b863b58739f Mon Sep 17 00:00:00 2001 +From bb9a8332e54fd6d2b0d4767b55c7df9a36ad3022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sun, 21 Jan 2018 18:55:31 +0100 Subject: [PATCH] cryptmodule: Include for declaration of crypt() if @@ -9,18 +9,18 @@ and may use an external or replacement library, like libxcrypt, for providing such functions. --- Modules/_cryptmodule.c | 4 ++++ - configure.ac | 4 ++++ - 2 files changed, 8 insertions(+) + configure.ac | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c -index 58d179e6a3..bb26d83f55 100644 +index 58d179e6a3..0031037b64 100644 --- a/Modules/_cryptmodule.c +++ b/Modules/_cryptmodule.c @@ -5,6 +5,10 @@ #include -+#if defined(HAVE_XCRYPT) ++#if defined(HAVE_CRYPT_H) +#include +#endif + @@ -28,20 +28,18 @@ index 58d179e6a3..bb26d83f55 100644 /*[clinic input] diff --git a/configure.ac b/configure.ac -index 39e2e8e769..129c198c15 100644 +index 39e2e8e769..79397a7a24 100644 --- a/configure.ac +++ b/configure.ac -@@ -2816,6 +2816,10 @@ LIBS="$withval $LIBS" - - PKG_PROG_PKG_CONFIG - -+# Check for libxcrypt is present. -+PKG_CHECK_MODULES([libxcrypt], libxcrypt, -+ AC_DEFINE([HAVE_XCRYPT], 1, [Define to 1 if libxcrypt is found.]), []) -+ - # Check for use of the system expat library - AC_MSG_CHECKING(for --with-system-expat) - AC_ARG_WITH(system_expat, +@@ -2049,7 +2049,7 @@ AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ + fcntl.h grp.h \ + ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ + sched.h shadow.h signal.h stropts.h termios.h \ +-unistd.h utime.h \ ++unistd.h crypt.h utime.h \ + poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ + sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ + sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ -- -2.16.0 +2.16.1 diff --git a/00291-setup-Link-ctypes-against-dl-explicitly.patch b/00291-setup-Link-ctypes-against-dl-explicitly.patch new file mode 100644 index 0000000..4bf4801 --- /dev/null +++ b/00291-setup-Link-ctypes-against-dl-explicitly.patch @@ -0,0 +1,25 @@ +From aae2ef0bace0e38f4ee5aaa4642aa32450a84216 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Tue, 23 Jan 2018 14:43:43 +0100 +Subject: [PATCH] setup: Link ctypes against dl explicitly + +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index c23628a2a9..9e40bb53e6 100644 +--- a/setup.py ++++ b/setup.py +@@ -1935,7 +1935,7 @@ class PyBuildExt(build_ext): + self.use_system_libffi = False + include_dirs = [] + extra_compile_args = [] +- extra_link_args = [] ++ extra_link_args = ['-ldl'] + sources = ['_ctypes/_ctypes.c', + '_ctypes/callbacks.c', + '_ctypes/callproc.c', +-- +2.16.1 + diff --git a/python37.spec b/python37.spec index a31689d..5e898b4 100644 --- a/python37.spec +++ b/python37.spec @@ -167,11 +167,6 @@ License: Python # on files that test invalid syntax. %undefine py_auto_byte_compile -# Disable strict symbol checks in the link editor. -# See: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af192613e1beec34824a94dc5f6feeeea1568?branch=master -# https://bugzilla.redhat.com/show_bug.cgi?id=1537489 -%undefine _strict_symbol_defs_build - # For multilib support, files that are different between 32- and 64-bit arches # need different filenames. Use "64" or "32" according to the word size. # Currently, the best way to determine an architecture's word size happens to @@ -386,6 +381,12 @@ Patch289: 00289-fix-nis-compilation.patch # Reported upstream: https://bugs.python.org/issue32635 Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch +# 00291 # +# Build fails with undefined references to dlopen / dlsym otherwise. +# See: https://bugzilla.redhat.com/show_bug.cgi?id=1537489 +# and: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19 +Patch291: 00291-setup-Link-ctypes-against-dl-explicitly.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -689,6 +690,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch274 -p1 %patch289 -p1 %patch290 -p1 +%patch291 -p1 # Remove files that should be generated by the build From 10ba826cb615a4b7f4666e353b5283d2206fc89e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 23 Jan 2018 17:18:20 +0100 Subject: [PATCH 26/67] Synced patch for libxcrypt with upstream --- ...ude-crypt.h-for-declaration-of-crypt.patch | 55 +++++++------------ python37.spec | 2 +- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch index 38aa7de..c5d768b 100644 --- a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch +++ b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch @@ -1,45 +1,28 @@ -From bb9a8332e54fd6d2b0d4767b55c7df9a36ad3022 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 21 Jan 2018 18:55:31 +0100 -Subject: [PATCH] cryptmodule: Include for declaration of crypt() if - needed - -Not every target system may provide a crypt() function in its stdlibc -and may use an external or replacement library, like libxcrypt, for -providing such functions. ---- - Modules/_cryptmodule.c | 4 ++++ - configure.ac | 2 +- - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c -index 58d179e6a3..0031037b64 100644 ---- a/Modules/_cryptmodule.c -+++ b/Modules/_cryptmodule.c -@@ -5,6 +5,10 @@ - - #include - -+#if defined(HAVE_CRYPT_H) +diff --git a/Include/Python.h b/Include/Python.h +index dd595ea5e4c..1feb1531cc9 100644 +--- a/Include/Python.h ++++ b/Include/Python.h +@@ -35,6 +35,9 @@ + #ifdef HAVE_UNISTD_H + #include + #endif ++#ifdef HAVE_CRYPT_H +#include +#endif -+ - /* Module crypt */ - /*[clinic input] + /* For size_t? */ + #ifdef HAVE_STDDEF_H diff --git a/configure.ac b/configure.ac -index 39e2e8e769..79397a7a24 100644 +index 03b0f501aff..15ef872a53a 100644 --- a/configure.ac +++ b/configure.ac -@@ -2049,7 +2049,7 @@ AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ +@@ -2041,7 +2041,7 @@ dnl AC_MSG_RESULT($cpp_type) + + # checks for header files + AC_HEADER_STDC +-AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ ++AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ sched.h shadow.h signal.h stropts.h termios.h \ --unistd.h utime.h \ -+unistd.h crypt.h utime.h \ - poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ - sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ - sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ --- -2.16.1 - + diff --git a/python37.spec b/python37.spec index 5e898b4..5961cf0 100644 --- a/python37.spec +++ b/python37.spec @@ -378,7 +378,7 @@ Patch289: 00289-fix-nis-compilation.patch # Not every target system may provide a crypt() function in its stdlibc # and may use an external or replacement library, like libxcrypt, for # providing such functions. -# Reported upstream: https://bugs.python.org/issue32635 +# Fixed upstream: https://bugs.python.org/issue32635 Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch # 00291 # From cea6d60615a84b72d036b1d324a2fd8e6613df3f Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Thu, 1 Feb 2018 18:50:40 +0100 Subject: [PATCH 27/67] Update to 3.7.0b1 - Rebase patches 102, 170 - Remove patches 273, 289, 290 --- 00102-lib64.patch | 21 ++--- 00170-gc-assertions.patch | 4 +- 00273-skip-float-test.patch | 12 --- 00289-fix-nis-compilation.patch | 83 ------------------- ...ude-crypt.h-for-declaration-of-crypt.patch | 28 ------- python37.spec | 37 +++------ 6 files changed, 18 insertions(+), 167 deletions(-) delete mode 100644 00273-skip-float-test.patch delete mode 100644 00289-fix-nis-compilation.patch delete mode 100644 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch diff --git a/00102-lib64.patch b/00102-lib64.patch index b48feda..b082083 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -70,8 +70,8 @@ index 7dc1b04..85016b4 100644 sitepackages.append(prefix) + sitepackages.append(os.path.join(prefix, "lib64", "site-packages")) sitepackages.append(os.path.join(prefix, "lib", "site-packages")) - # for framework builds *only* we add the standard Apple locations. - if sys.platform == "darwin" and sys._framework: + return sitepackages + diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 9ee4d31..53c8606 100644 --- a/Lib/sysconfig.py @@ -109,9 +109,9 @@ index 266adf0..e8513b6 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase): - self.assertEqual(dirs[1], wanted) - elif os.sep == '/': - # OS X non-framework builds, Linux, FreeBSD, etc + dirs = site.getsitepackages() + if os.sep == '/': + # OS X, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', + self.assertEqual(len(dirs), 2) @@ -190,14 +190,3 @@ index f1933f7..450cd8a 100644 extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -871,8 +871,8 @@ class PyBuildExt(build_ext): - if krb5_h: - ssl_incs += krb5_h - ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, -- ['/usr/local/ssl/lib', -- '/usr/contrib/ssl/lib/' -+ ['/usr/local/ssl/lib64', -+ '/usr/contrib/ssl/lib64/' - ] ) - - if (ssl_incs is not None and diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index 1f71939..0412e0d 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -60,8 +60,8 @@ index 904fc7d..5676007 100644 import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, -- temp_dir, requires_type_collecting) -+ temp_dir, import_module, requires_type_collecting) +- temp_dir, requires_type_collecting,reap_threads) ++ temp_dir,reap_threads, import_module, requires_type_collecting) from test.support.script_helper import assert_python_ok, make_script import sys diff --git a/00273-skip-float-test.patch b/00273-skip-float-test.patch deleted file mode 100644 index 233d3ed..0000000 --- a/00273-skip-float-test.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py -index 66726d6496d..3318fa5df59 100644 ---- a/Lib/test/test_float.py -+++ b/Lib/test/test_float.py -@@ -141,6 +141,7 @@ class GeneralFloatCases(unittest.TestCase): - # non-UTF-8 byte string - check(b'123\xa0') - -+ @unittest.skip('Fails in Koji: https://bugzilla.redhat.com/show_bug.cgi?id=1484497') - @support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE') - def test_float_with_comma(self): - # set locale to something that doesn't use '.' for the decimal point diff --git a/00289-fix-nis-compilation.patch b/00289-fix-nis-compilation.patch deleted file mode 100644 index 4d4e3dc..0000000 --- a/00289-fix-nis-compilation.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/setup.py b/setup.py -index 3eb6ad1..3437e48 100644 ---- a/setup.py -+++ b/setup.py -@@ -1331,20 +1331,14 @@ class PyBuildExt(build_ext): - exts.append( Extension('termios', ['termios.c']) ) - # Jeremy Hylton's rlimit interface - exts.append( Extension('resource', ['resource.c']) ) -+ else: -+ missing.extend(['resource', 'termios']) - -- # Sun yellow pages. Some systems have the functions in libc. -- if (host_platform not in ['cygwin', 'qnx6'] and -- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): -- if (self.compiler.find_library_file(lib_dirs, 'nsl')): -- libs = ['nsl'] -- else: -- libs = [] -- exts.append( Extension('nis', ['nismodule.c'], -- libraries = libs) ) -- else: -- missing.append('nis') -+ nis = self._detect_nis(inc_dirs, lib_dirs) -+ if nis is not None: -+ exts.append(nis) - else: -- missing.extend(['nis', 'resource', 'termios']) -+ missing.append('nis') - - # Curses support, requiring the System V version of curses, often - # provided by the ncurses library. -@@ -2179,6 +2173,51 @@ class PyBuildExt(build_ext): - ) - return ext - -+ def _detect_nis(self, inc_dirs, lib_dirs): -+ if host_platform in {'win32', 'cygwin', 'qnx6'}: -+ return None -+ -+ libs = [] -+ library_dirs = [] -+ includes_dirs = [] -+ -+ # Latest glibc has moved Sun RPC headers into tircp and nsl sub -+ # directories. rpc code has been moved to libtirpc. -+ rpcsvc_inc = find_file( -+ 'rpcsvc/yp_prot.h', inc_dirs, -+ ['/usr/local/include/nsl', '/usr/include/nsl'] -+ ) -+ rpc_inc = find_file( -+ 'rpc/rpc.h', inc_dirs, -+ ['/usr/local/include/tirpc', '/usr/include/tirpc'] -+ ) -+ if rpcsvc_inc is None or rpc_inc is None: -+ # not found -+ return None -+ includes_dirs.extend(rpcsvc_inc) -+ includes_dirs.extend(rpc_inc) -+ -+ if self.compiler.find_library_file(lib_dirs, 'nsl'): -+ libs.append('nsl') -+ else: -+ # libnsl-devel: check for libnsl in nsl/ subdirectory -+ nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in lib_dirs] -+ libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl') -+ if libnsl is not None: -+ library_dirs.append(os.path.dirname(libnsl)) -+ libs.append('nsl') -+ -+ if self.compiler.find_library_file(lib_dirs, 'tirpc'): -+ libs.append('tirpc') -+ -+ return Extension( -+ 'nis', ['nismodule.c'], -+ libraries=libs, -+ library_dirs=library_dirs, -+ include_dirs=includes_dirs -+ ) -+ -+ - class PyBuildInstall(install): - # Suppress the warning about installation into the lib_dynload - # directory, which is not in sys.path when running Python during diff --git a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch deleted file mode 100644 index c5d768b..0000000 --- a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/Include/Python.h b/Include/Python.h -index dd595ea5e4c..1feb1531cc9 100644 ---- a/Include/Python.h -+++ b/Include/Python.h -@@ -35,6 +35,9 @@ - #ifdef HAVE_UNISTD_H - #include - #endif -+#ifdef HAVE_CRYPT_H -+#include -+#endif - - /* For size_t? */ - #ifdef HAVE_STDDEF_H -diff --git a/configure.ac b/configure.ac -index 03b0f501aff..15ef872a53a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2041,7 +2041,7 @@ dnl AC_MSG_RESULT($cpp_type) - - # checks for header files - AC_HEADER_STDC --AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ -+AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ - fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ - sched.h shadow.h signal.h stropts.h termios.h \ - diff --git a/python37.spec b/python37.spec index 5961cf0..adfd31a 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Second alpha -%global prerel a4 +%global prerel b1 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.6.%{?prerel}%{?dist} +Release: 0.7.%{?prerel}%{?dist} License: Python @@ -356,31 +356,10 @@ Patch251: 00251-change-user-install-location.patch # Reported upstream: http://bugs.python.org/issue29804 Patch264: 00264-skip-test-failing-on-aarch64.patch -# 00273 # -# Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError -# See https://bugzilla.redhat.com/show_bug.cgi?id=1484497 -Patch273: 00273-skip-float-test.patch - # 00274 # # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch -# 00289 # -# Fix the compilation of the nis module, as glibc removed the -# interfaces related to Sun RPC and they are now provided -# by libtirpc and libnsl2. -# See: https://fedoraproject.org/wiki/Changes/SunRPCRemoval -# and https://fedoraproject.org/wiki/Changes/NISIPv6 -# Fixed upstream: https://bugs.python.org/issue32521 -Patch289: 00289-fix-nis-compilation.patch - -# 00290 # -# Not every target system may provide a crypt() function in its stdlibc -# and may use an external or replacement library, like libxcrypt, for -# providing such functions. -# Fixed upstream: https://bugs.python.org/issue32635 -Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch - # 00291 # # Build fails with undefined references to dlopen / dlsym otherwise. # See: https://bugzilla.redhat.com/show_bug.cgi?id=1537489 @@ -686,10 +665,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch264 -p1 %endif -%patch273 -p1 %patch274 -p1 -%patch289 -p1 -%patch290 -p1 %patch291 -p1 @@ -1227,6 +1203,7 @@ CheckPython optimized %{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so %{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so %{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so +%{dynload_dir}/_contextvars.%{SOABI_optimized}.so %{dynload_dir}/_crypt.%{SOABI_optimized}.so %{dynload_dir}/_csv.%{SOABI_optimized}.so %{dynload_dir}/_ctypes.%{SOABI_optimized}.so @@ -1248,11 +1225,13 @@ CheckPython optimized %{dynload_dir}/_opcode.%{SOABI_optimized}.so %{dynload_dir}/_pickle.%{SOABI_optimized}.so %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so +%{dynload_dir}/_queue.%{SOABI_optimized}.so %{dynload_dir}/_random.%{SOABI_optimized}.so %{dynload_dir}/_socket.%{SOABI_optimized}.so %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so %{dynload_dir}/_ssl.%{SOABI_optimized}.so %{dynload_dir}/_struct.%{SOABI_optimized}.so +%{dynload_dir}/_xxsubinterpreters.%{SOABI_optimized}.so %{dynload_dir}/array.%{SOABI_optimized}.so %{dynload_dir}/audioop.%{SOABI_optimized}.so %{dynload_dir}/binascii.%{SOABI_optimized}.so @@ -1490,6 +1469,7 @@ CheckPython optimized %{dynload_dir}/_codecs_jp.%{SOABI_debug}.so %{dynload_dir}/_codecs_kr.%{SOABI_debug}.so %{dynload_dir}/_codecs_tw.%{SOABI_debug}.so +%{dynload_dir}/_contextvars.%{SOABI_debug}.so %{dynload_dir}/_crypt.%{SOABI_debug}.so %{dynload_dir}/_csv.%{SOABI_debug}.so %{dynload_dir}/_ctypes.%{SOABI_debug}.so @@ -1511,11 +1491,13 @@ CheckPython optimized %{dynload_dir}/_opcode.%{SOABI_debug}.so %{dynload_dir}/_pickle.%{SOABI_debug}.so %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so +%{dynload_dir}/_queue.%{SOABI_debug}.so %{dynload_dir}/_random.%{SOABI_debug}.so %{dynload_dir}/_socket.%{SOABI_debug}.so %{dynload_dir}/_sqlite3.%{SOABI_debug}.so %{dynload_dir}/_ssl.%{SOABI_debug}.so %{dynload_dir}/_struct.%{SOABI_debug}.so +%{dynload_dir}/_xxsubinterpreters.%{SOABI_debug}.so %{dynload_dir}/array.%{SOABI_debug}.so %{dynload_dir}/audioop.%{SOABI_debug}.so %{dynload_dir}/binascii.%{SOABI_debug}.so @@ -1592,6 +1574,9 @@ CheckPython optimized # ====================================================== %changelog +* Mon Feb 12 2018 Iryna Shcherbina - 3.7.0-0.7.b1 +- Update to 3.7.0b1 + * Fri Feb 09 2018 Fedora Release Engineering - 3.7.0-0.6.a4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From d84538b320e2013a786d7d1e391bfebd059f69a5 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Wed, 31 Jan 2018 15:16:02 +0100 Subject: [PATCH 28/67] Disable test_gdb for all arches and test_buffer for ppc64le in anticipation of the F28 mass rebuild - Re-enable these tests after the mass rebuild when they can be properly addressed --- python37.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python37.spec b/python37.spec index adfd31a..90d1b84 100644 --- a/python37.spec +++ b/python37.spec @@ -1067,14 +1067,15 @@ CheckPython() { -wW --slowest --findleaks \ -x test_distutils \ -x test_bdist_rpm \ + -x test_gdb \ %ifarch ppc64le aarch64 -x test_faulthandler \ %endif %ifarch %{mips64} -x test_ctypes \ %endif - %ifarch %{power64} s390 s390x armv7hl aarch64 %{mips} - -x test_gdb + %ifarch ppc64le + -x test_buffer \ %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From 02bfb4dc2a67905bc9b84f20c0b7db2eb1647598 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 1 Feb 2018 11:20:15 +0100 Subject: [PATCH 29/67] Define TLS cipher suite on build time --- python37.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python37.spec b/python37.spec index 90d1b84..c880daf 100644 --- a/python37.spec +++ b/python37.spec @@ -738,6 +738,7 @@ BuildPython() { --enable-loadable-sqlite-extensions \ --with-dtrace \ --with-lto \ + --with-ssl-default-suites=openssl \ %if %{with valgrind} --with-valgrind \ %endif @@ -1577,6 +1578,7 @@ CheckPython optimized %changelog * Mon Feb 12 2018 Iryna Shcherbina - 3.7.0-0.7.b1 - Update to 3.7.0b1 +- Define TLS cipher suite on build time * Fri Feb 09 2018 Fedora Release Engineering - 3.7.0-0.6.a4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From cc54a40057b61c03c7107f0247fb4a62371d4a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Feb 2018 19:44:15 +0100 Subject: [PATCH 30/67] 3.7.0b1 sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 9fd642f..126d4f3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0a4.tar.xz) = 3d9517fb381258e21548e3e88de88592adc75bc37fddf21e79149d7706d85f5df816ffcc170603ce93959c76d903d4fd4c0231b5b0b2b430c21701cc303d9e5a +SHA512 (Python-3.7.0b1.tar.xz) = c2c9d76c310987e1998504ae6270350e7afd3834923143fe9f9e7ad130a491f2d1b45f26aff4c3ce5e6133979098da68e865aaabfc1dc6ff4227e6ef969cd50c From 0679427e979f6d97e22768e08cae87be7b1f807f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 14 Feb 2018 18:48:02 +0100 Subject: [PATCH 31/67] Readd ldconfig scriplets via macro --- python37.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index c880daf..a93a3b2 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.7.%{?prerel}%{?dist} +Release: 0.8.%{?prerel}%{?dist} License: Python @@ -1094,6 +1094,15 @@ CheckPython optimized %endif # with tests +# Remove this when F27 EOL +%if %{with flatpackage} +%ldconfig_scriptlets +%else +%ldconfig_scriptlets libs +%ldconfig_scriptlets debug +%endif + + %files %defattr(-, root, root) %license LICENSE @@ -1576,6 +1585,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Feb 14 2018 Miro Hrončok - 3.7.0-0.8.b1 +- Readd ldconfig scriplets via macro + * Mon Feb 12 2018 Iryna Shcherbina - 3.7.0-0.7.b1 - Update to 3.7.0b1 - Define TLS cipher suite on build time From 1161a4660dd81e52329d42d5bc09e78d7433ad70 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 8 Feb 2018 14:54:08 +0100 Subject: [PATCH 32/67] Fix the name macro in the description --- python37.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index a93a3b2..6a34652 100644 --- a/python37.spec +++ b/python37.spec @@ -425,7 +425,7 @@ language, designed with an emphasis on code readibility. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. -The ${name} package provides the "python3" executable: the reference +The %{name} package provides the "python3" executable: the reference interpreter for the Python language, version 3. The majority of its standard library is provided in the %{name}-libs package, which should be installed automatically along with %{name}. From 654b8b4665cea3fe6148dd0110b65bbe0bc93a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 15 Feb 2018 14:34:07 +0100 Subject: [PATCH 33/67] Fix the name macro in the description 2 --- python37.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 6a34652..022a16b 100644 --- a/python37.spec +++ b/python37.spec @@ -565,7 +565,7 @@ The self-test suite for the Python interpreter. This is only useful to test Python itself. For testing general Python code, you should use the unittest module from %{name}-libs, or a library such as -${name}-pytest or ${name}-nose. +%{name}-pytest or %{name}-nose. %if %{with debug_build} From ac19ab7c07949909d9858dd743d1bfcfe12434ef Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Mon, 12 Feb 2018 17:43:19 +0100 Subject: [PATCH 34/67] Fix rpmlint errors: spelling, tabs (bz#1535596) --- python37.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python37.spec b/python37.spec index 022a16b..3992856 100644 --- a/python37.spec +++ b/python37.spec @@ -148,7 +148,7 @@ License: Python # has bytecode at: # foo/__pycache__/bar.cpython-%%{pyshortver}.pyc # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc -# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc +# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc %global bytecode_suffixes .cpython-%{pyshortver}*.pyc # Python's configure script defines SOVERSION, and this is used in the Makefile @@ -421,7 +421,7 @@ Requires: python3-pip # The description used both for the SRPM and the main `python3` subpackage: %description Python is an accessible, high-level, dynamically typed, interpreted programming -language, designed with an emphasis on code readibility. +language, designed with an emphasis on code readability. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. @@ -573,7 +573,7 @@ you should use the unittest module from %{name}-libs, or a library such as Summary: Debug version of the Python runtime # The debug build is an all-in-one package version of the regular build, and -# shares the same .py/.pyc files and directories as the regular build. Hence +# shares the same .py/.pyc files and directories as the regular build. Hence # we depend on all of the subpackages of the regular build: Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -598,7 +598,7 @@ separately. The debug build shares installation directories with the standard Python runtime, so that .py and .pyc files can be shared. Compiled extension modules use a special ABI flag ("d") in the filename, -so extensions for both verisons can co-exist in the same directory. +so extensions for both versions can co-exist in the same directory. %endif # with debug_build %else # with flatpackage From 627aaf656c2780cf22b88ba4dbca7caa3a4f21b7 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 13 Feb 2018 11:16:40 +0100 Subject: [PATCH 35/67] Remove not used patches Should have been removed with update to 3.6.3 https://src.fedoraproject.org/rpms/python37/c/47069ff4171cd7fafa42544033bef8589ad04304 --- 00270-fix-ssl-alpn-hook-test.patch | 16 --- ...1-asyncio-get-default-signal-handler.patch | 99 ------------------- 00272-fix-ftplib-to-reject-newlines.patch | 58 ----------- 3 files changed, 173 deletions(-) delete mode 100644 00270-fix-ssl-alpn-hook-test.patch delete mode 100644 00271-asyncio-get-default-signal-handler.patch delete mode 100644 00272-fix-ftplib-to-reject-newlines.patch diff --git a/00270-fix-ssl-alpn-hook-test.patch b/00270-fix-ssl-alpn-hook-test.patch deleted file mode 100644 index 97b433e..0000000 --- a/00270-fix-ssl-alpn-hook-test.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py -index d203cdd..c128dae 100644 ---- a/Lib/test/test_ssl.py -+++ b/Lib/test/test_ssl.py -@@ -3256,8 +3256,9 @@ if _have_threads: - except ssl.SSLError as e: - stats = e - -- if expected is None and IS_OPENSSL_1_1: -- # OpenSSL 1.1.0 raises handshake error -+ if (expected is None and IS_OPENSSL_1_1 -+ and ssl.OPENSSL_VERSION_INFO < (1, 1, 0, 6)): -+ # OpenSSL 1.1.0 to 1.1.0e raises handshake error - self.assertIsInstance(stats, ssl.SSLError) - else: - msg = "failed trying %s (s) and %s (c).\n" \ diff --git a/00271-asyncio-get-default-signal-handler.patch b/00271-asyncio-get-default-signal-handler.patch deleted file mode 100644 index 8b1bf77..0000000 --- a/00271-asyncio-get-default-signal-handler.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py -index 492a84a2313..9746678607c 100644 ---- a/Lib/test/test_asyncio/test_events.py -+++ b/Lib/test/test_asyncio/test_events.py -@@ -1980,19 +1980,26 @@ def test_subprocess_terminate(self): - - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") - def test_subprocess_send_signal(self): -- prog = os.path.join(os.path.dirname(__file__), 'echo.py') -- -- connect = self.loop.subprocess_exec( -- functools.partial(MySubprocessProtocol, self.loop), -- sys.executable, prog) -- transp, proto = self.loop.run_until_complete(connect) -- self.assertIsInstance(proto, MySubprocessProtocol) -- self.loop.run_until_complete(proto.connected) -- -- transp.send_signal(signal.SIGHUP) -- self.loop.run_until_complete(proto.completed) -- self.assertEqual(-signal.SIGHUP, proto.returncode) -- transp.close() -+ # bpo-31034: Make sure that we get the default signal handler (killing -+ # the process). The parent process may have decided to ignore SIGHUP, -+ # and signal handlers are inherited. -+ old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL) -+ try: -+ prog = os.path.join(os.path.dirname(__file__), 'echo.py') -+ -+ connect = self.loop.subprocess_exec( -+ functools.partial(MySubprocessProtocol, self.loop), -+ sys.executable, prog) -+ transp, proto = self.loop.run_until_complete(connect) -+ self.assertIsInstance(proto, MySubprocessProtocol) -+ self.loop.run_until_complete(proto.connected) -+ -+ transp.send_signal(signal.SIGHUP) -+ self.loop.run_until_complete(proto.completed) -+ self.assertEqual(-signal.SIGHUP, proto.returncode) -+ transp.close() -+ finally: -+ signal.signal(signal.SIGHUP, old_handler) - - def test_subprocess_stderr(self): - prog = os.path.join(os.path.dirname(__file__), 'echo2.py') -diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py -index 2e14a8a9735..e8822c36698 100644 ---- a/Lib/test/test_asyncio/test_subprocess.py -+++ b/Lib/test/test_asyncio/test_subprocess.py -@@ -166,25 +166,32 @@ def test_terminate(self): - - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") - def test_send_signal(self): -- code = 'import time; print("sleeping", flush=True); time.sleep(3600)' -- args = [sys.executable, '-c', code] -- create = asyncio.create_subprocess_exec(*args, -- stdout=subprocess.PIPE, -- loop=self.loop) -- proc = self.loop.run_until_complete(create) -- -- @asyncio.coroutine -- def send_signal(proc): -- # basic synchronization to wait until the program is sleeping -- line = yield from proc.stdout.readline() -- self.assertEqual(line, b'sleeping\n') -+ # bpo-31034: Make sure that we get the default signal handler (killing -+ # the process). The parent process may have decided to ignore SIGHUP, -+ # and signal handlers are inherited. -+ old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL) -+ try: -+ code = 'import time; print("sleeping", flush=True); time.sleep(3600)' -+ args = [sys.executable, '-c', code] -+ create = asyncio.create_subprocess_exec(*args, -+ stdout=subprocess.PIPE, -+ loop=self.loop) -+ proc = self.loop.run_until_complete(create) - -- proc.send_signal(signal.SIGHUP) -- returncode = (yield from proc.wait()) -- return returncode -- -- returncode = self.loop.run_until_complete(send_signal(proc)) -- self.assertEqual(-signal.SIGHUP, returncode) -+ @asyncio.coroutine -+ def send_signal(proc): -+ # basic synchronization to wait until the program is sleeping -+ line = yield from proc.stdout.readline() -+ self.assertEqual(line, b'sleeping\n') -+ -+ proc.send_signal(signal.SIGHUP) -+ returncode = (yield from proc.wait()) -+ return returncode -+ -+ returncode = self.loop.run_until_complete(send_signal(proc)) -+ self.assertEqual(-signal.SIGHUP, returncode) -+ finally: -+ signal.signal(signal.SIGHUP, old_handler) - - def prepare_broken_pipe_test(self): - # buffer large enough to feed the whole pipe buffer diff --git a/00272-fix-ftplib-to-reject-newlines.patch b/00272-fix-ftplib-to-reject-newlines.patch deleted file mode 100644 index 66486a8..0000000 --- a/00272-fix-ftplib-to-reject-newlines.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 8c2d4cf092c5f0335e7982392a33927579c4d512 Mon Sep 17 00:00:00 2001 -From: Dong-hee Na -Date: Wed, 26 Jul 2017 21:11:25 +0900 -Subject: [PATCH] [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error - for a illegal command (#1214) (#2886) - ---- - Lib/ftplib.py | 2 ++ - Lib/test/test_ftplib.py | 6 +++++- - Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst | 2 ++ - 3 files changed, 9 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst - -diff --git a/Lib/ftplib.py b/Lib/ftplib.py -index 8f36f537e8a..a02e595cb02 100644 ---- a/Lib/ftplib.py -+++ b/Lib/ftplib.py -@@ -186,6 +186,8 @@ def sanitize(self, s): - - # Internal: send one line to the server, appending CRLF - def putline(self, line): -+ if '\r' in line or '\n' in line: -+ raise ValueError('an illegal newline character should not be contained') - line = line + CRLF - if self.debugging > 1: - print('*put*', self.sanitize(line)) -diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py -index 12fabc5e8be..a561e9efa03 100644 ---- a/Lib/test/test_ftplib.py -+++ b/Lib/test/test_ftplib.py -@@ -484,6 +484,9 @@ def test_sanitize(self): - self.assertEqual(self.client.sanitize('PASS 12345'), repr('PASS *****')) - - def test_exceptions(self): -+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r\n0') -+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\n0') -+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r0') - self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 400') - self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 499') - self.assertRaises(ftplib.error_perm, self.client.sendcmd, 'echo 500') -@@ -492,7 +495,8 @@ def test_exceptions(self): - - def test_all_errors(self): - exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm, -- ftplib.error_proto, ftplib.Error, OSError, EOFError) -+ ftplib.error_proto, ftplib.Error, OSError, -+ EOFError) - for x in exceptions: - try: - raise x('exception not included in all_errors set') -diff --git a/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst -new file mode 100644 -index 00000000000..a37d3703842 ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst -@@ -0,0 +1,2 @@ -+ftplib.FTP.putline() now throws ValueError on commands that contains CR or -+LF. Patch by Dong-hee Na. From f3f5f60ac09feb66c0c1381deedaa85cdec5da14 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 13 Feb 2018 13:49:21 +0100 Subject: [PATCH 36/67] Fix deprecation warning on using imp In build log fixes the following warning: /builddir/build/SOURCES/check-pyc-and-pyo-timestamps.py:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp --- check-pyc-and-pyo-timestamps.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/check-pyc-and-pyo-timestamps.py b/check-pyc-and-pyo-timestamps.py index 76a3421..262a985 100644 --- a/check-pyc-and-pyo-timestamps.py +++ b/check-pyc-and-pyo-timestamps.py @@ -1,6 +1,6 @@ """Checks if all *.pyc and *.pyo files have later mtime than their *.py files.""" -import imp +import importlib.util import os import sys @@ -37,16 +37,18 @@ not_compiled = [ ] failed = 0 + def bytecode_expected(source): for f in not_compiled: if source.endswith(f): return False return True + compiled = filter(lambda f: bytecode_expected(f), sys.argv[1:]) for f in compiled: # check both pyo and pyc - to_check = map(lambda b: imp.cache_from_source(f, b), (True, False)) + to_check = map(lambda b: importlib.util.cache_from_source(f, b), (True, False)) f_mtime = os.path.getmtime(f) for c in to_check: c_mtime = os.path.getmtime(c) From 9203532359bcd2631b67c56d89098264413b502d Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 13 Feb 2018 16:23:24 +0100 Subject: [PATCH 37/67] Remove unused Postfix argument from InstallPython It was used for Systemtap hooks, which were removed recently: https://src.fedoraproject.org/rpms/python37/c/31d212b3c7fa592942d18607d1146c189936e754 --- python37.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python37.spec b/python37.spec index 3992856..ccea761 100644 --- a/python37.spec +++ b/python37.spec @@ -815,7 +815,6 @@ InstallPython() { PyInstSoName=$2 MoreCFlags=$3 LDVersion=$4 - Postfix=$5 # Switch to the directory with this configuration's built files ConfDir=build/$ConfName @@ -869,16 +868,14 @@ EOF InstallPython debug \ %{py_INSTSONAME_debug} \ -O0 \ - %{LDVERSION_debug} \ - -debug + %{LDVERSION_debug} %endif # with debug_build # Now the optimized build: InstallPython optimized \ %{py_INSTSONAME_optimized} \ "" \ - %{LDVERSION_optimized} \ - "" + %{LDVERSION_optimized} # Install directories for additional packages install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ From bf7378574e55db46ceff9cc1c207f7a851dda132 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Fri, 16 Feb 2018 15:33:54 +0100 Subject: [PATCH 38/67] Remove sys.executable check from change-user-install-location patch Resolves: rhbz#1532287 --- 00251-change-user-install-location.patch | 28 ++++++++++++------------ python37.spec | 6 ++++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 1dcd9f2..4104449 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -1,19 +1,20 @@ diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index 9d31d13..ed44a93 100644 +index 0258d3d..4ebf50a 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py -@@ -424,8 +424,18 @@ class install(Command): +@@ -418,8 +418,19 @@ class install(Command): raise DistutilsOptionError( "must not supply exec-prefix without prefix") - self.prefix = os.path.normpath(sys.prefix) - self.exec_prefix = os.path.normpath(sys.exec_prefix) + # self.prefix is set to sys.prefix + /local/ -+ # if the executable is /usr/bin/python* and RPM build -+ # is not detected to make pip and distutils install into -+ # the separate location. -+ if (sys.executable.startswith("/usr/bin/python") -+ and 'RPM_BUILD_ROOT' not in os.environ): ++ # if neither RPM build nor virtual environment is ++ # detected to make pip and distutils install packages ++ # into the separate location. ++ if (not (hasattr(sys, 'real_prefix') or ++ sys.prefix != sys.base_prefix) and ++ 'RPM_BUILD_ROOT' not in os.environ): + addition = "/local" + else: + addition = "" @@ -24,22 +25,21 @@ index 9d31d13..ed44a93 100644 else: if self.exec_prefix is None: diff --git a/Lib/site.py b/Lib/site.py -index 4744eb0..b5fe571 100644 +index 0fc9200..c95202e 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -326,7 +326,15 @@ def getsitepackages(prefixes=None): +@@ -322,7 +322,14 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): - """Add site-packages to sys.path""" -+ """Add site-packages to sys.path. ++ """Add site-packages to sys.path + -+ '/usr/local' is included in PREFIXES if the executable is /usr/bin/python* -+ and RPM build is not detected to make sudo pip installed packages visible. ++ '/usr/local' is included in PREFIXES if RPM build is not detected ++ to make packages installed into this location visible. + + """ -+ if (ENABLE_USER_SITE and sys.executable.startswith("/usr/bin/python") -+ and 'RPM_BUILD_ROOT' not in os.environ): ++ if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ: + PREFIXES.insert(0, "/usr/local") for sitedir in getsitepackages(prefixes): if os.path.isdir(sitedir): diff --git a/python37.spec b/python37.spec index ccea761..a7b832b 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.8.%{?prerel}%{?dist} +Release: 0.9.%{?prerel}%{?dist} License: Python @@ -1582,6 +1582,10 @@ CheckPython optimized # ====================================================== %changelog +* Thu Feb 15 2018 Michal Cyprian - 3.7.0-0.9.b1 +- Remove sys.executable check from change-user-install-location patch +Resolves: rhbz#1532287 + * Wed Feb 14 2018 Miro Hrončok - 3.7.0-0.8.b1 - Readd ldconfig scriplets via macro From 6e4c18d0c79a0748f9166817b85436c4d8503755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 17 Feb 2018 21:01:39 +0100 Subject: [PATCH 39/67] Remove %ldconfig_scriptlets (F28+ only) %ldconfig_scriptlets does nothing on F28+. The original idea was to keep is present not to unnecessarily diverge master and f27, but since that have happened anyway, I'm removing it for spec simplicity. Not adding a new changelog entry (it's not user facing) nor bumping the release (it doesn't need to be rebuilt, it changes nothing). Altering the changelog entry that was added when %ldconfig_scriptlets was added. --- python37.spec | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/python37.spec b/python37.spec index a7b832b..f759380 100644 --- a/python37.spec +++ b/python37.spec @@ -1091,15 +1091,6 @@ CheckPython optimized %endif # with tests -# Remove this when F27 EOL -%if %{with flatpackage} -%ldconfig_scriptlets -%else -%ldconfig_scriptlets libs -%ldconfig_scriptlets debug -%endif - - %files %defattr(-, root, root) %license LICENSE @@ -1587,7 +1578,7 @@ CheckPython optimized Resolves: rhbz#1532287 * Wed Feb 14 2018 Miro Hrončok - 3.7.0-0.8.b1 -- Readd ldconfig scriplets via macro +- Readd ldconfig scriplets via macro (later removed on F28+ only) * Mon Feb 12 2018 Iryna Shcherbina - 3.7.0-0.7.b1 - Update to 3.7.0b1 From 06a649c4a515f8865ffd7dce1b95eb48f308287c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 21 Feb 2018 14:35:54 +0100 Subject: [PATCH 40/67] Filter out automatic /usr/bin/python3.X requirement... ...recommend the main package from libs instead. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1547131 --- python37.spec | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index f759380..29aadcc 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.9.%{?prerel}%{?dist} +Release: 0.10.%{?prerel}%{?dist} License: Python @@ -418,6 +418,14 @@ Requires: python3-setuptools Requires: python3-pip %endif +# This prevents ALL subpackages built from this spec to require +# /usr/bin/python3*. Granularity per subpackage is impossible. +# It's intended for the libs package not to drag in the interpreter, see +# https://bugzilla.redhat.com/show_bug.cgi?id=1547131 +# All others require %%{name} anyway. +%global __requires_exclude ^/usr/bin/python3 + + # The description used both for the SRPM and the main `python3` subpackage: %description Python is an accessible, high-level, dynamically typed, interpreted programming @@ -456,6 +464,12 @@ Requires: glibc%{?_isa} >= 2.24.90-26 Requires: gdbm%{?_isa} >= 1:1.13 %endif +# There are files in the standard library that have python shebang. +# We've filtered the automatic requirement out so libs are installable without +# the main package. This however makes it pulled in by default. +# See https://bugzilla.redhat.com/show_bug.cgi?id=1547131 +Recommends: %{name}%{?_isa} = %{version}-%{release} + # For backward compatibility only, remove in F29: Provides: system-python-libs = %{version}-%{release} Provides: system-python-libs%{?_isa} = %{version}-%{release} @@ -1573,6 +1587,11 @@ CheckPython optimized # ====================================================== %changelog +* Wed Feb 21 2018 Miro Hrončok - 3.7.0-0.10.b1 +- Filter out automatic /usr/bin/python3.X requirement, + recommend the main package from libs instead +Resolves: rhbz#1547131 + * Thu Feb 15 2018 Michal Cyprian - 3.7.0-0.9.b1 - Remove sys.executable check from change-user-install-location patch Resolves: rhbz#1532287 From de5e1e875a0b659077bc0ea5ea623246f1bb4948 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 14 Feb 2018 17:10:48 +0100 Subject: [PATCH 41/67] test_pass_by_value no longer fails on aarch64; patch removed --- 00264-skip-test-failing-on-aarch64.patch | 12 ------------ python37.spec | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 00264-skip-test-failing-on-aarch64.patch diff --git a/00264-skip-test-failing-on-aarch64.patch b/00264-skip-test-failing-on-aarch64.patch deleted file mode 100644 index edda219..0000000 --- a/00264-skip-test-failing-on-aarch64.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py -index 3eded77..ad7859a 100644 ---- a/Lib/ctypes/test/test_structures.py -+++ b/Lib/ctypes/test/test_structures.py -@@ -392,6 +392,7 @@ class StructureTestCase(unittest.TestCase): - (1, 0, 0, 0, 0, 0)) - self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7)) - -+ @unittest.skip('Fails on aarch64: http://bugs.python.org/issue29804') - def test_pass_by_value(self): - # This should mirror the structure in Modules/_ctypes/_ctypes_test.c - class X(Structure): diff --git a/python37.spec b/python37.spec index 29aadcc..df10049 100644 --- a/python37.spec +++ b/python37.spec @@ -349,13 +349,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.patch -# 00264 # -# test_pass_by_value was added in Python 3.6.1 and on aarch64 -# it is catching an error that was there, but wasn't tested before. -# Therefore skipping the test on aarch64 until fixed upstream. -# Reported upstream: http://bugs.python.org/issue29804 -Patch264: 00264-skip-test-failing-on-aarch64.patch - # 00274 # # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch @@ -674,11 +667,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch251 -p1 - -%ifarch aarch64 -%patch264 -p1 -%endif - %patch274 -p1 %patch291 -p1 From a2c6e9ba550ec1d5de0d4be035e83e0e91906d19 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 14 Feb 2018 22:29:50 +0100 Subject: [PATCH 42/67] Do not skip test_faulthandler on ppc64le and aarch64 as it no longer fails --- python37.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python37.spec b/python37.spec index df10049..58cc1e4 100644 --- a/python37.spec +++ b/python37.spec @@ -1060,17 +1060,12 @@ CheckPython() { # our non-standard decorators take effect on the relevant tests: # @unittest._skipInRpmBuild(reason) # @unittest._expectedFailureInRpmBuild - # test_faulthandler.test_register_chain currently fails on ppc64le and - # aarch64, see upstream bug http://bugs.python.org/issue21131 WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest --findleaks \ -x test_distutils \ -x test_bdist_rpm \ -x test_gdb \ - %ifarch ppc64le aarch64 - -x test_faulthandler \ - %endif %ifarch %{mips64} -x test_ctypes \ %endif From f52973f5cbf85052d695a4f4fad06aa1c8edc7c9 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 20 Feb 2018 18:56:34 +0100 Subject: [PATCH 43/67] Reenable test_gdb on x86_64 The test was disabled for Python 3.6.4 where it fails currently, but it completes successfully on Python 3.7. See commit: https://src.fedoraproject.org/rpms/python37/c/d84538b320e2013a786d7d1e391bfebd059f69a5 Enable also runnig test_gdb on aarch64, as failures are no longer observed. The bugzilla associated with the reqson why it was disabled is long closed. See commit: https://src.fedoraproject.org/rpms/python37/c/3b7dcebf399c67228916767bb92e75dd2613baa8 --- python37.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 58cc1e4..fda232b 100644 --- a/python37.spec +++ b/python37.spec @@ -1065,10 +1065,12 @@ CheckPython() { -wW --slowest --findleaks \ -x test_distutils \ -x test_bdist_rpm \ - -x test_gdb \ %ifarch %{mips64} -x test_ctypes \ %endif + %ifarch %{power64} s390 s390x armv7hl %{mips} + -x test_gdb \ + %endif %ifarch ppc64le -x test_buffer \ %endif From 6a6a8d45dde27e4c29d133fa3956d14f8593ec61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 18 Jan 2018 16:53:05 +0100 Subject: [PATCH 44/67] Fix the py_byte_compile macro to work on Python 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://bugzilla.redhat.com/show_bug.cgi?id=1484993 Inspired by Terje Røsten's workaround from that bugzilla This also removes the pybytecompile macro file from the flat package because it doesn't belong there as pointed out during the review and later forgotten. --- macros.pybytecompile3.7 | 21 ++++++++++++++++++--- python37.spec | 11 ++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/macros.pybytecompile3.7 b/macros.pybytecompile3.7 index 3968c6e..f319979 100644 --- a/macros.pybytecompile3.7 +++ b/macros.pybytecompile3.7 @@ -3,8 +3,23 @@ # Python's compile_all module only works on directories, and requires a max # recursion depth +# Note that the py_byte_compile macro should work for python2 as well +# Which unfortunately makes the definition more complicated than it should be +# The condition should be reversed once /usr/bin/python is python3! + %py_byte_compile()\ -python_binary="%1"\ -bytecode_compilation_path="%2"\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ +py2_byte_compile () {\ + python_binary="%1"\ + bytecode_compilation_path="%2"\ + find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ + find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +}\ +\ +py3_byte_compile () {\ + python_binary="%1"\ + bytecode_compilation_path="%2"\ + find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ +}\ +\ +[[ "%1" == *python3* ]] || py2_byte_compile "%1" "%2" && py3_byte_compile "%1" "%2" \ %{nil} diff --git a/python37.spec b/python37.spec index fda232b..85b9e06 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.10.%{?prerel}%{?dist} +Release: 0.11.%{?prerel}%{?dist} License: Python @@ -964,9 +964,9 @@ rm -rf %{buildroot}%{_bindir}/__pycache__ find %{buildroot} -perm 555 -exec chmod 755 {} \; # Install macros for rpm: +%if %{without flatpackage} mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ -%if %{without flatpackage} install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ %endif @@ -1365,6 +1365,7 @@ CheckPython optimized %{_bindir}/python3-config %{_libdir}/pkgconfig/python3.pc %{_rpmconfigdir}/macros.d/macros.systempython +%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %{_bindir}/pathfix.py %endif @@ -1374,7 +1375,6 @@ CheckPython optimized %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc -%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %if %{without flatpackage} @@ -1572,6 +1572,11 @@ CheckPython optimized # ====================================================== %changelog +* Wed Feb 21 2018 Miro Hrončok - 3.7.0-0.11.b1 +- Fix the py_byte_compile macro to work on Python 2 +- Remove the pybytecompile macro file from the flat package +Resolves: rhbz#1484993 + * Wed Feb 21 2018 Miro Hrončok - 3.7.0-0.10.b1 - Filter out automatic /usr/bin/python3.X requirement, recommend the main package from libs instead From ef18b4528ad79fa920867ec85532baee647410ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 28 Feb 2018 10:30:29 +0100 Subject: [PATCH 45/67] Update to 3.7.0b2 --- 00111-no-static-lib.patch | 12 ++++++------ 00170-gc-assertions.patch | 40 +++++++++++++++++++-------------------- python37.spec | 7 +++++-- sources | 2 +- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 50cc13a..5bfff87 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,9 +1,9 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in -index a5a9d5e..51e8132 100644 +index 0eddd13..7ed4f3c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -530,7 +530,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c - $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) +@@ -565,7 +565,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -11,7 +11,7 @@ index a5a9d5e..51e8132 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt -@@ -574,12 +574,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -609,12 +609,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build @@ -24,7 +24,7 @@ index a5a9d5e..51e8132 100644 libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -667,7 +661,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist +@@ -702,7 +696,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi @@ -33,7 +33,7 @@ index a5a9d5e..51e8132 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1408,17 +1402,6 @@ libainstall: @DEF_MAKE_RULE@ python-config +@@ -1460,17 +1454,6 @@ libainstall: @DEF_MAKE_RULE@ python-config else true; \ fi; \ done diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index 0412e0d..c37e69c 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -1,8 +1,8 @@ diff --git a/Include/object.h b/Include/object.h -index cb57359..f928f97 100644 +index c772dea..5729797 100644 --- a/Include/object.h +++ b/Include/object.h -@@ -1069,6 +1069,49 @@ PyAPI_FUNC(void) +@@ -1098,6 +1098,49 @@ PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ @@ -53,15 +53,15 @@ index cb57359..f928f97 100644 } #endif diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py -index 904fc7d..5676007 100644 +index 904fc7d..288e242 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,10 +1,11 @@ import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, -- temp_dir, requires_type_collecting,reap_threads) -+ temp_dir,reap_threads, import_module, requires_type_collecting) +- temp_dir, requires_type_collecting) ++ temp_dir, import_module, requires_type_collecting) from test.support.script_helper import assert_python_ok, make_script import sys @@ -130,10 +130,10 @@ index 904fc7d..5676007 100644 def setUp(self): gc.enable() diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c -index 6e26c7a..8410206 100644 +index 8ba1093..e795308 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c -@@ -238,7 +238,8 @@ update_refs(PyGC_Head *containers) +@@ -239,7 +239,8 @@ update_refs(PyGC_Head *containers) { PyGC_Head *gc = containers->gc.gc_next; for (; gc != containers; gc = gc->gc.gc_next) { @@ -143,7 +143,7 @@ index 6e26c7a..8410206 100644 _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); /* Python's cyclic gc should never see an incoming refcount * of 0: if something decref'ed to 0, it should have been -@@ -258,7 +259,8 @@ update_refs(PyGC_Head *containers) +@@ -259,7 +260,8 @@ update_refs(PyGC_Head *containers) * so serious that maybe this should be a release-build * check instead of an assert? */ @@ -153,7 +153,7 @@ index 6e26c7a..8410206 100644 } } -@@ -273,7 +275,9 @@ visit_decref(PyObject *op, void *data) +@@ -274,7 +276,9 @@ visit_decref(PyObject *op, void *data) * generation being collected, which can be recognized * because only they have positive gc_refs. */ @@ -164,7 +164,7 @@ index 6e26c7a..8410206 100644 if (_PyGCHead_REFS(gc) > 0) _PyGCHead_DECREF(gc); } -@@ -333,9 +337,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) +@@ -334,9 +338,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) * If gc_refs == GC_UNTRACKED, it must be ignored. */ else { @@ -178,7 +178,7 @@ index 6e26c7a..8410206 100644 } } return 0; -@@ -377,7 +382,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) +@@ -378,7 +383,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) */ PyObject *op = FROM_GC(gc); traverseproc traverse = Py_TYPE(op)->tp_traverse; @@ -187,7 +187,7 @@ index 6e26c7a..8410206 100644 _PyGCHead_SET_REFS(gc, GC_REACHABLE); (void) traverse(op, (visitproc)visit_reachable, -@@ -440,7 +445,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) +@@ -441,7 +446,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); @@ -196,7 +196,7 @@ index 6e26c7a..8410206 100644 next = gc->gc.gc_next; if (has_legacy_finalizer(op)) { -@@ -516,7 +521,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -517,7 +522,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) PyWeakReference **wrlist; op = FROM_GC(gc); @@ -205,7 +205,7 @@ index 6e26c7a..8410206 100644 next = gc->gc.gc_next; if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) -@@ -537,9 +542,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -538,9 +543,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) * the callback pointer intact. Obscure: it also * changes *wrlist. */ @@ -217,7 +217,7 @@ index 6e26c7a..8410206 100644 if (wr->wr_callback == NULL) continue; /* no callback */ -@@ -573,7 +578,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -574,7 +579,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) */ if (IS_TENTATIVELY_UNREACHABLE(wr)) continue; @@ -226,7 +226,7 @@ index 6e26c7a..8410206 100644 /* Create a new reference so that wr can't go away * before we can process it again. -@@ -582,7 +587,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -583,7 +588,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) /* Move wr to wrcb_to_call, for the next pass. */ wrasgc = AS_GC(wr); @@ -236,7 +236,7 @@ index 6e26c7a..8410206 100644 next isn't, so they can't be the same */ gc_list_move(wrasgc, &wrcb_to_call); -@@ -598,11 +604,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -599,11 +605,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) gc = wrcb_to_call.gc.gc_next; op = FROM_GC(gc); @@ -251,7 +251,7 @@ index 6e26c7a..8410206 100644 /* copy-paste of weakrefobject.c's handle_callback() */ temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); -@@ -719,12 +725,14 @@ check_garbage(PyGC_Head *collectable) +@@ -720,12 +726,14 @@ check_garbage(PyGC_Head *collectable) for (gc = collectable->gc.gc_next; gc != collectable; gc = gc->gc.gc_next) { _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); @@ -269,10 +269,10 @@ index 6e26c7a..8410206 100644 return -1; } diff --git a/Objects/object.c b/Objects/object.c -index ed8a62a..5279b15 100644 +index 220aa90..f6c7161 100644 --- a/Objects/object.c +++ b/Objects/object.c -@@ -2116,6 +2116,35 @@ _PyTrash_thread_destroy_chain(void) +@@ -2177,6 +2177,35 @@ _PyTrash_thread_destroy_chain(void) --tstate->trash_delete_nesting; } diff --git a/python37.spec b/python37.spec index 85b9e06..b7070c2 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Second alpha -%global prerel b1 +%global prerel b2 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.11.%{?prerel}%{?dist} +Release: 0.12.%{?prerel}%{?dist} License: Python @@ -1572,6 +1572,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Feb 28 2018 Miro Hrončok - 3.7.0-0.12.b2 +- Update to 3.7.0b2 + * Wed Feb 21 2018 Miro Hrončok - 3.7.0-0.11.b1 - Fix the py_byte_compile macro to work on Python 2 - Remove the pybytecompile macro file from the flat package diff --git a/sources b/sources index 126d4f3..8d99783 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0b1.tar.xz) = c2c9d76c310987e1998504ae6270350e7afd3834923143fe9f9e7ad130a491f2d1b45f26aff4c3ce5e6133979098da68e865aaabfc1dc6ff4227e6ef969cd50c +SHA512 (Python-3.7.0b2.tar.xz) = 15941cb2c14ad9fbabc6ff7085796ef7d44832bdffd4db662c8578732018154b0385408b28147dbaff1ad8f3158c1cc48d579898436842fc7101580e89503f7d From acda1a219a580e20d4e587d7b1338af926ac7ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 1 Mar 2018 15:19:51 +0100 Subject: [PATCH 46/67] Use %% for actual % in spec rpmlint reports this as macro in comment, however it was left here, because it is not macro and not comment. On the other hand, % shall be escaped using %%. All this needs to blow is somebody defining a macro called _pyconfig64_h. --- python37.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python37.spec b/python37.spec index b7070c2..e6f1ea3 100644 --- a/python37.spec +++ b/python37.spec @@ -853,9 +853,9 @@ InstallPython() { #include #if __WORDSIZE == 32 -#include "%{_pyconfig32_h}" +#include "%%{_pyconfig32_h}" #elif __WORDSIZE == 64 -#include "%{_pyconfig64_h}" +#include "%%{_pyconfig64_h}" #else #error "Unknown word size" #endif From 42c61b3ece6f15eb2733fce5cb09be0a7bf6d48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 1 Mar 2018 15:21:59 +0100 Subject: [PATCH 47/67] Add rpmlintrc file Filter all the errors and warnings. This allows us to actually read the rpmlint output to get new information. From now on, we can rely on this information when pushing updates. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1548683 --- python37.rpmlintrc | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 python37.rpmlintrc diff --git a/python37.rpmlintrc b/python37.rpmlintrc new file mode 100644 index 0000000..42a5f41 --- /dev/null +++ b/python37.rpmlintrc @@ -0,0 +1,46 @@ +# KNOWN BUGS: +# https://bugzilla.redhat.com/show_bug.cgi?id=1489816 +addFilter(r'crypto-policy-non-compliance-openssl') + + +# TESTS: +addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3.\d/test') + + +# OTHER DELIBERATES: +# chroot function +addFilter(r'missing-call-to-chdir-with-chroot') + +# intentionally unversioned +addFilter(r'unversioned-explicit-obsoletes python') + +# intentionally hardcoded +addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})') + +# intentional for our pythonXY package +addFilter(r'python3\d\.[^:]+: (E|W): devel-file-in-non-devel-package') + + +# SORRY, NOT SORRY: +# manual pages +addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv-)3\.\d$') +addFilter(r'no-manual-page-for-binary python3.*-config$') +addFilter(r'no-manual-page-for-binary python3.\dm$') + + +# RPMLINT IMPERFECTIONS +# https://github.com/rpm-software-management/rpmlint/issues/123 +addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found 3393') + +# https://bugzilla.redhat.com/show_bug.cgi?id=1550562 +# https://github.com/rpm-software-management/rpmlint/issues/128 +addFilter(r'python-bytecode-inconsistent-mtime .* 1970') + +# debugsource +addFilter(r'^python3\d?-debugsource\.[^:]+: (E|W): no-documentation') + +# debuginfo +addFilter(r'^python3\d?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)') + +# this is OK for F28+ +addFilter(r'library-without-ldconfig-post') From 94ba907c0b9e5db6edb54844da38c8f4cb9985f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 1 Mar 2018 16:00:00 +0100 Subject: [PATCH 48/67] rpmlintrc: Add stuff from the nonflat package --- python37.rpmlintrc | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/python37.rpmlintrc b/python37.rpmlintrc index 42a5f41..58bf02b 100644 --- a/python37.rpmlintrc +++ b/python37.rpmlintrc @@ -11,8 +11,9 @@ addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3 # chroot function addFilter(r'missing-call-to-chdir-with-chroot') -# intentionally unversioned +# intentionally unversioned and selfobsoleted addFilter(r'unversioned-explicit-obsoletes python') +addFilter(r'self-obsoletion python3\d obsoletes python3\d') # intentionally hardcoded addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})') @@ -20,12 +21,25 @@ addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{p # intentional for our pythonXY package addFilter(r'python3\d\.[^:]+: (E|W): devel-file-in-non-devel-package') +# we have non binary stuff, python files +addFilter(r'only-non-binary-in-usr-lib') + +# some devel files that are deliberately needed +addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\dm/pyconfig-(32|64)\.h') +addFilter(r'devel-file-in-non-devel-package /usr/lib64/python3\.\d/distutils/tests/xxmodule\.c') + # SORRY, NOT SORRY: # manual pages -addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv-)3\.\d$') +addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3-debug|pathfix\.py)') addFilter(r'no-manual-page-for-binary python3.*-config$') -addFilter(r'no-manual-page-for-binary python3.\dm$') +addFilter(r'no-manual-page-for-binary python3.\dd?m$') + +# missing documentation from subpackages +addFilter(r'^python3\d?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation') + +# platform python is obsoleted, but not provided +addFilter(r'obsolete-not-provided platform-python') # RPMLINT IMPERFECTIONS @@ -44,3 +58,14 @@ addFilter(r'^python3\d?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(bui # this is OK for F28+ addFilter(r'library-without-ldconfig-post') + +# debug package contains devel and non-devel files +addFilter(r'python3\d?-debug.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package') + +# this goes to other subpackage, hence not actually dangling, the read error is bogus +addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc python-3\.\d\.pc') +addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc \[Errno 2\]') + + +# SPELLING ERRORS +addFilter(r'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ') From 3777cb5efa3e34405b4dfa4c49c49a3241104ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 24 Mar 2018 08:02:08 +0100 Subject: [PATCH 49/67] Fix broken macro invocation and broken building of C Python extensions Revert "Use %% for actual % in spec" This reverts commit acda1a219a580e20d4e587d7b1338af926ac7ece. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1560103 --- python37.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python37.spec b/python37.spec index e6f1ea3..25e3fda 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.12.%{?prerel}%{?dist} +Release: 0.13.%{?prerel}%{?dist} License: Python @@ -853,9 +853,9 @@ InstallPython() { #include #if __WORDSIZE == 32 -#include "%%{_pyconfig32_h}" +#include "%{_pyconfig32_h}" #elif __WORDSIZE == 64 -#include "%%{_pyconfig64_h}" +#include "%{_pyconfig64_h}" #else #error "Unknown word size" #endif @@ -1572,6 +1572,10 @@ CheckPython optimized # ====================================================== %changelog +* Sat Mar 24 2018 Miro Hrončok - 3.7.0-0.13.b2 +- Fix broken macro invocation and broken building of C Python extensions +Resolves: rhbz#1560103 + * Wed Feb 28 2018 Miro Hrončok - 3.7.0-0.12.b2 - Update to 3.7.0b2 From 34f9f5ef13fdd1f6c4c777cec6f33b819753cc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 24 Mar 2018 08:06:56 +0100 Subject: [PATCH 50/67] rpmlintrc: Filter macro-in-comment %{_pyconfig(32|64)_h} --- python37.rpmlintrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python37.rpmlintrc b/python37.rpmlintrc index 58bf02b..f91b865 100644 --- a/python37.rpmlintrc +++ b/python37.rpmlintrc @@ -66,6 +66,8 @@ addFilter(r'python3\d?-debug.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-pac addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc python-3\.\d\.pc') addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc \[Errno 2\]') +# we need this macro to evaluate, even if the line starts with # +addFilter(r'macro-in-comment %\{_pyconfig(32|64)_h\}') # SPELLING ERRORS addFilter(r'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ') From cb0fe74d039bd711652463cebc60a9ad332db955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 25 Mar 2018 20:55:08 +0200 Subject: [PATCH 51/67] Fix shebangs of the GDB hooks Also, use -p (preserve timestamp) and -n (don't create backup files) with pathfix.py. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1560295 --- python37.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python37.spec b/python37.spec index 25e3fda..c410903 100644 --- a/python37.spec +++ b/python37.spec @@ -924,8 +924,9 @@ cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/ # so handle files named using other naming scheme separately. LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ Tools/scripts/pathfix.py \ - -i "%{_bindir}/python%{pybasever}" \ - %{buildroot} + -i "%{_bindir}/python%{pybasever}" -pn \ + %{buildroot} \ + %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py} # Remove tests for python3-tools which was removed in # https://bugzilla.redhat.com/show_bug.cgi?id=1312030 From 6f038c8edef24fd89d21ae6b9db53c096fef4864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 27 Mar 2018 13:24:32 +0200 Subject: [PATCH 52/67] Update setuptools and pip bundled versions --- python37.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python37.spec b/python37.spec index c410903..9427085 100644 --- a/python37.spec +++ b/python37.spec @@ -618,8 +618,8 @@ Requires: redhat-rpm-config %global __provides_exclude ^python\\(abi\\) = 3\\..$ # We keep those inside on purpose -Provides: bundled(python3-pip) = 9.0.1 -Provides: bundled(python3-setuptools) = 28.8.0 +Provides: bundled(python3-pip) = 9.0.3 +Provides: bundled(python3-setuptools) = 39.0.1 # The descripton for the flat flatpackage package %description From a50d5ce8642d2e8895fa049fb8e04b0742ed21ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 29 Mar 2018 15:00:59 +0200 Subject: [PATCH 53/67] Update to 3.7.0b3 --- python37.spec | 9 ++++++--- sources | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python37.spec b/python37.spec index 9427085..5ebfa83 100644 --- a/python37.spec +++ b/python37.spec @@ -12,13 +12,13 @@ Summary: Version %{pybasever} of the Python interpreter URL: https://www.python.org/ -# Second alpha -%global prerel b2 +# Third beta +%global prerel b3 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.13.%{?prerel}%{?dist} +Release: 0.14.%{?prerel}%{?dist} License: Python @@ -1573,6 +1573,9 @@ CheckPython optimized # ====================================================== %changelog +* Thu Mar 29 2018 Miro Hrončok - 3.7.0-0.14.b3 +- Update to 3.7.0b3 + * Sat Mar 24 2018 Miro Hrončok - 3.7.0-0.13.b2 - Fix broken macro invocation and broken building of C Python extensions Resolves: rhbz#1560103 diff --git a/sources b/sources index 8d99783..3a10973 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0b2.tar.xz) = 15941cb2c14ad9fbabc6ff7085796ef7d44832bdffd4db662c8578732018154b0385408b28147dbaff1ad8f3158c1cc48d579898436842fc7101580e89503f7d +SHA512 (Python-3.7.0b3.tar.xz) = 4fd605cb1621e4bed73c2aadf0443fb70b4d013e9d93a26e81e75dc56906062660b63ac1d97224da217d5e05a3372802a291924a26cc067959d8e1e753a8356f From 3422f8b4a46c8d4cfd09bf88be2e89562b188fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 29 Mar 2018 15:01:56 +0200 Subject: [PATCH 54/67] Remove macros.pybytecompile3.7 It will live in python-rpm-macros, see: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/4 --- macros.pybytecompile3.7 | 25 ------------------------- python37.spec | 7 ------- 2 files changed, 32 deletions(-) delete mode 100644 macros.pybytecompile3.7 diff --git a/macros.pybytecompile3.7 b/macros.pybytecompile3.7 deleted file mode 100644 index f319979..0000000 --- a/macros.pybytecompile3.7 +++ /dev/null @@ -1,25 +0,0 @@ -# Note that the path could itself be a python file, or a directory - -# Python's compile_all module only works on directories, and requires a max -# recursion depth - -# Note that the py_byte_compile macro should work for python2 as well -# Which unfortunately makes the definition more complicated than it should be -# The condition should be reversed once /usr/bin/python is python3! - -%py_byte_compile()\ -py2_byte_compile () {\ - python_binary="%1"\ - bytecode_compilation_path="%2"\ - find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ - find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ -}\ -\ -py3_byte_compile () {\ - python_binary="%1"\ - bytecode_compilation_path="%2"\ - find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ -}\ -\ -[[ "%1" == *python3* ]] || py2_byte_compile "%1" "%2" && py3_byte_compile "%1" "%2" \ -%{nil} diff --git a/python37.spec b/python37.spec index 5ebfa83..b314587 100644 --- a/python37.spec +++ b/python37.spec @@ -242,11 +242,6 @@ BuildRequires: python3-pip Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}.tar.xz -# Supply an RPM macro "py_byte_compile" for the python3-devel subpackage -# to enable specfiles to selectively byte-compile individual files and paths -# with different Python runtimes as necessary: -Source3: macros.pybytecompile%{pybasever} - # A simple script to check timestamps of bytecode files # Run in check section with Python that is currently being built # Written by bkabrda @@ -967,7 +962,6 @@ find %{buildroot} -perm 555 -exec chmod 755 {} \; # Install macros for rpm: %if %{without flatpackage} mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ -install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ %endif @@ -1366,7 +1360,6 @@ CheckPython optimized %{_bindir}/python3-config %{_libdir}/pkgconfig/python3.pc %{_rpmconfigdir}/macros.d/macros.systempython -%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %{_bindir}/pathfix.py %endif From 8799184fe77c6332b853f31d26ef29db743700f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 29 Mar 2018 15:04:40 +0200 Subject: [PATCH 55/67] Remove macros.systempython It was for backward compatibility only, to be removed in F29. This will only become non-flat package in F29+. --- macros.systempython | 1 - python37.spec | 11 ----------- 2 files changed, 12 deletions(-) delete mode 100644 macros.systempython diff --git a/macros.systempython b/macros.systempython deleted file mode 100644 index 314cd45..0000000 --- a/macros.systempython +++ /dev/null @@ -1 +0,0 @@ -%system_python_abi %{expand: } diff --git a/python37.spec b/python37.spec index b314587..6fb6b3c 100644 --- a/python37.spec +++ b/python37.spec @@ -247,10 +247,6 @@ Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}. # Written by bkabrda Source8: check-pyc-and-pyo-timestamps.py -# Backward compatible no-op macro for system-python -# Remove in Fedora 29 -Source9: macros.systempython - # Desktop menu entry for idle3 Source10: idle3.desktop @@ -959,12 +955,6 @@ rm -rf %{buildroot}%{_bindir}/__pycache__ # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} -perm 555 -exec chmod 755 {} \; -# Install macros for rpm: -%if %{without flatpackage} -mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ -install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ -%endif - # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 @@ -1359,7 +1349,6 @@ CheckPython optimized %if %{without flatpackage} %{_bindir}/python3-config %{_libdir}/pkgconfig/python3.pc -%{_rpmconfigdir}/macros.d/macros.systempython %{_bindir}/pathfix.py %endif From fc23c477cf09d8415e3b3e2172861c149218f4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 18 Apr 2018 17:14:16 +0200 Subject: [PATCH 56/67] Typos and such From https://src.fedoraproject.org/rpms/python3/pull-request/33 --- python37.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python37.spec b/python37.spec index 6fb6b3c..04bd2d6 100644 --- a/python37.spec +++ b/python37.spec @@ -379,7 +379,7 @@ Obsoletes: system-python < %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} # In order to support multiple Python interpreters for development purposes, -# packages with with the naming scheme flatpackage (e.g. python35) exist for +# packages with the naming scheme flatpackage (e.g. python35) exist for # non-default versions of Python 3. # For consistency, and to keep the upgrade path clean, we Provide/Obsolete # these names here. @@ -612,9 +612,11 @@ Requires: redhat-rpm-config Provides: bundled(python3-pip) = 9.0.3 Provides: bundled(python3-setuptools) = 39.0.1 -# The descripton for the flat flatpackage package +# The description for the flat package %description -This package exists to allow developers to test their code against an newer +Python %{pybasever} package for developers. + +This package exists to allow developers to test their code against a newer version of Python. This is not a full Python stack and if you wish to run your applications with Python %{pybasever}, update your Fedora to a newer version once Python %{pybasever} is stable. From 872e1bafb7741fedab810841e99ad0eec4cc1b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 19 Apr 2018 18:08:13 +0200 Subject: [PATCH 57/67] Skip test_multiprocessing_fork(server) and _spawn for now It hangs the build --- python37.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 04bd2d6..0407d87 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.14.%{?prerel}%{?dist} +Release: 0.15.%{?prerel}%{?dist} License: Python @@ -1061,6 +1061,9 @@ CheckPython() { %ifarch ppc64le -x test_buffer \ %endif + -x test_multiprocessing_fork \ + -x test_multiprocessing_forkserver \ + -x test_multiprocessing_spawn \ echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1557,6 +1560,9 @@ CheckPython optimized # ====================================================== %changelog +* Thu Apr 19 2018 Miro Hrončok - 3.7.0-0.15.b3 +- Skip test_multiprocessing_fork(server) and _spawn for now + * Thu Mar 29 2018 Miro Hrončok - 3.7.0-0.14.b3 - Update to 3.7.0b3 From 240a1f769d717f588c2a671716d194b3c4454866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 23 Apr 2018 13:39:24 +0200 Subject: [PATCH 58/67] Fix multiprocessing regression on newer glibcs Enable test_multiprocessing_fork(server) and _spawn again Resolves: rhbz#1569933 --- ...rocessing-regression-on-newer-glibcs.patch | 55 +++++++++++++++++++ python37.spec | 17 ++++-- 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 00302-fix-multiprocessing-regression-on-newer-glibcs.patch diff --git a/00302-fix-multiprocessing-regression-on-newer-glibcs.patch b/00302-fix-multiprocessing-regression-on-newer-glibcs.patch new file mode 100644 index 0000000..965792a --- /dev/null +++ b/00302-fix-multiprocessing-regression-on-newer-glibcs.patch @@ -0,0 +1,55 @@ +From a3febe3cba14b89885f42ca2f0224096a52885f6 Mon Sep 17 00:00:00 2001 +From: Antoine Pitrou +Date: Mon, 23 Apr 2018 13:19:42 +0200 +Subject: [PATCH] bpo-33329: Fix multiprocessing regression on newer glibcs + +Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some +reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom +is commonly used to select all signals for blocking with `pthread_sigmask`. +So we ignore the sigaddset() return value until we expose sigfillset() +to provide a better idiom. +--- + .../next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst | 1 + + Modules/signalmodule.c | 14 ++++++++------ + 2 files changed, 9 insertions(+), 6 deletions(-) + create mode 100644 Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst + +diff --git a/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst b/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst +new file mode 100644 +index 000000000000..d1a4e56d04b9 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst +@@ -0,0 +1 @@ ++Fix multiprocessing regression on newer glibcs +diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c +index 791616014384..35fd87e2d1e7 100644 +--- a/Modules/signalmodule.c ++++ b/Modules/signalmodule.c +@@ -819,7 +819,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) + int result = -1; + PyObject *iterator, *item; + long signum; +- int err; + + sigemptyset(mask); + +@@ -841,11 +840,14 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) + Py_DECREF(item); + if (signum == -1 && PyErr_Occurred()) + goto error; +- if (0 < signum && signum < NSIG) +- err = sigaddset(mask, (int)signum); +- else +- err = 1; +- if (err) { ++ if (0 < signum && signum < NSIG) { ++ /* bpo-33329: ignore sigaddset() return value as it can fail ++ * for some reserved signals, but we want the `range(1, NSIG)` ++ * idiom to allow selecting all valid signals. ++ */ ++ (void) sigaddset(mask, (int)signum); ++ } ++ else { + PyErr_Format(PyExc_ValueError, + "signal number %ld out of range", signum); + goto error; diff --git a/python37.spec b/python37.spec index 0407d87..28bbba0 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.15.%{?prerel}%{?dist} +Release: 0.16.%{?prerel}%{?dist} License: Python @@ -350,6 +350,12 @@ Patch274: 00274-fix-arch-names.patch # and: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19 Patch291: 00291-setup-Link-ctypes-against-dl-explicitly.patch +# 00302 # +# Fix multiprocessing regression on newer glibcs +# See: https://bugzilla.redhat.com/show_bug.cgi?id=1569933 +# and: https://bugs.python.org/issue33329 +Patch302: 00302-fix-multiprocessing-regression-on-newer-glibcs.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -662,6 +668,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch251 -p1 %patch274 -p1 %patch291 -p1 +%patch302 -p1 # Remove files that should be generated by the build @@ -1061,9 +1068,6 @@ CheckPython() { %ifarch ppc64le -x test_buffer \ %endif - -x test_multiprocessing_fork \ - -x test_multiprocessing_forkserver \ - -x test_multiprocessing_spawn \ echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1560,6 +1564,11 @@ CheckPython optimized # ====================================================== %changelog +* Mon Apr 23 2018 Miro Hrončok - 3.7.0-0.16.b3 +- Fix multiprocessing regression on newer glibcs +- Enable test_multiprocessing_fork(server) and _spawn again +Resolves: rhbz#1569933 + * Thu Apr 19 2018 Miro Hrončok - 3.7.0-0.15.b3 - Skip test_multiprocessing_fork(server) and _spawn for now From 0c391afb695caa6f78857957ba9a733a8e598ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 10 May 2018 14:47:13 +0200 Subject: [PATCH 59/67] Update to 3.7.0b4 --- 00274-fix-arch-names.patch | 41 +++++++------- ...rocessing-regression-on-newer-glibcs.patch | 55 ------------------- 00304-test-posix-pass-environ.patch | 13 +++++ python37.spec | 20 ++++--- sources | 2 +- 5 files changed, 47 insertions(+), 84 deletions(-) delete mode 100644 00302-fix-multiprocessing-regression-on-newer-glibcs.patch create mode 100644 00304-test-posix-pass-environ.patch diff --git a/00274-fix-arch-names.patch b/00274-fix-arch-names.patch index 9d69223..c8e53c1 100644 --- a/00274-fix-arch-names.patch +++ b/00274-fix-arch-names.patch @@ -1,7 +1,21 @@ -diff -up Python-3.5.0/configure.ac.than Python-3.5.0/configure.ac ---- Python-3.5.0/configure.ac.than 2015-11-13 11:51:32.039560172 -0500 -+++ Python-3.5.0/configure.ac 2015-11-13 11:52:11.670168157 -0500 -@@ -788,9 +788,9 @@ cat >> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c < -Date: Mon, 23 Apr 2018 13:19:42 +0200 -Subject: [PATCH] bpo-33329: Fix multiprocessing regression on newer glibcs - -Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some -reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom -is commonly used to select all signals for blocking with `pthread_sigmask`. -So we ignore the sigaddset() return value until we expose sigfillset() -to provide a better idiom. ---- - .../next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst | 1 + - Modules/signalmodule.c | 14 ++++++++------ - 2 files changed, 9 insertions(+), 6 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst - -diff --git a/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst b/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst -new file mode 100644 -index 000000000000..d1a4e56d04b9 ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst -@@ -0,0 +1 @@ -+Fix multiprocessing regression on newer glibcs -diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c -index 791616014384..35fd87e2d1e7 100644 ---- a/Modules/signalmodule.c -+++ b/Modules/signalmodule.c -@@ -819,7 +819,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) - int result = -1; - PyObject *iterator, *item; - long signum; -- int err; - - sigemptyset(mask); - -@@ -841,11 +840,14 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) - Py_DECREF(item); - if (signum == -1 && PyErr_Occurred()) - goto error; -- if (0 < signum && signum < NSIG) -- err = sigaddset(mask, (int)signum); -- else -- err = 1; -- if (err) { -+ if (0 < signum && signum < NSIG) { -+ /* bpo-33329: ignore sigaddset() return value as it can fail -+ * for some reserved signals, but we want the `range(1, NSIG)` -+ * idiom to allow selecting all valid signals. -+ */ -+ (void) sigaddset(mask, (int)signum); -+ } -+ else { - PyErr_Format(PyExc_ValueError, - "signal number %ld out of range", signum); - goto error; diff --git a/00304-test-posix-pass-environ.patch b/00304-test-posix-pass-environ.patch new file mode 100644 index 0000000..9780674 --- /dev/null +++ b/00304-test-posix-pass-environ.patch @@ -0,0 +1,13 @@ +diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py +index da0135b..1b27b5f 100644 +--- a/Lib/test/test_posix.py ++++ b/Lib/test/test_posix.py +@@ -1463,7 +1463,7 @@ class TestPosixSpawn(unittest.TestCase): + """ + pid = posix.posix_spawn(sys.executable, + [sys.executable, '-c', script], +- {'foo': 'bar'}) ++ {**os.environ, 'foo': 'bar'}) + self.assertEqual(os.waitpid(pid, 0), (pid, 0)) + with open(envfile) as f: + self.assertEqual(f.read(), 'bar') diff --git a/python37.spec b/python37.spec index 28bbba0..a0097d9 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Third beta -%global prerel b3 +%global prerel b4 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.16.%{?prerel}%{?dist} +Release: 0.17.%{?prerel}%{?dist} License: Python @@ -350,11 +350,12 @@ Patch274: 00274-fix-arch-names.patch # and: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19 Patch291: 00291-setup-Link-ctypes-against-dl-explicitly.patch -# 00302 # -# Fix multiprocessing regression on newer glibcs -# See: https://bugzilla.redhat.com/show_bug.cgi?id=1569933 -# and: https://bugs.python.org/issue33329 -Patch302: 00302-fix-multiprocessing-regression-on-newer-glibcs.patch +# 00304 # +# Pass os.environ to new process created at test_posix::test_specify_environment +# Otherwise important variables such as LD_LIBRARY_PATH are not set and the +# child process might not work at all +# Proposed upstream: https://bugs.python.org/issue33455 +Patch304: 00304-test-posix-pass-environ.patch # (New patches go here ^^^) # @@ -668,7 +669,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch251 -p1 %patch274 -p1 %patch291 -p1 -%patch302 -p1 +%patch304 -p1 # Remove files that should be generated by the build @@ -1564,6 +1565,9 @@ CheckPython optimized # ====================================================== %changelog +* Thu May 10 2018 Miro Hrončok - 3.7.0-0.17.b4 +- Update to 3.7.0b4 + * Mon Apr 23 2018 Miro Hrončok - 3.7.0-0.16.b3 - Fix multiprocessing regression on newer glibcs - Enable test_multiprocessing_fork(server) and _spawn again diff --git a/sources b/sources index 3a10973..abc3c00 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0b3.tar.xz) = 4fd605cb1621e4bed73c2aadf0443fb70b4d013e9d93a26e81e75dc56906062660b63ac1d97224da217d5e05a3372802a291924a26cc067959d8e1e753a8356f +SHA512 (Python-3.7.0b4.tar.xz) = e97459a5467a984a5a2bfc08ed937dfeb899f3d4ff9a655878badffc19e722efc30112422c14f94fcf9f6c82ee01e9fe2bb538db83454e4c83b711d1a8444472 From 8810a59050a8c0d34545a11108a267532444b1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 11 May 2018 23:27:10 +0200 Subject: [PATCH 60/67] Only require python3-rpm-generators when built with rewheel Without rewheel is used to bootstrap setuptools+pip python3-rpm-generators needs python3-setuptools, so we cannot have it yet --- python37.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python37.spec b/python37.spec index a0097d9..99fed63 100644 --- a/python37.spec +++ b/python37.spec @@ -484,7 +484,12 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: python-rpm-macros Requires: python-rpm-macros Requires: python3-rpm-macros + +%if %{with rewheel} +# without rewheel is used to bootstrap setuptools+pip +# python3-rpm-generators needs python3-setuptools, so we cannot have it yet Requires: python3-rpm-generators +%endif # https://bugzilla.redhat.com/show_bug.cgi?id=1217376 # https://bugzilla.redhat.com/show_bug.cgi?id=1496757 From 63266cf9edfbe760dab8234988723688d6670550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 12 May 2018 10:48:48 +0200 Subject: [PATCH 61/67] Rebase the rewheel patch It was not rebased before, because it was never applied --- 00189-add-rewheel-module.patch | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index bae64d4..d8ba671 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -1,5 +1,5 @@ diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py -index d69e09f..5cb12df 100644 +index 7ff938b..8c3d062 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -1,8 +1,10 @@ @@ -13,16 +13,25 @@ index d69e09f..5cb12df 100644 __all__ = ["version", "bootstrap"] -@@ -25,6 +27,8 @@ def _run_pip(args, additional_paths=None): +@@ -24,8 +26,15 @@ def _run_pip(args, additional_paths=None): + sys.path = additional_paths + sys.path # Install the bundled software - import pip +- import pip._internal +- return pip._internal.main(args) ++ try: ++ # pip 10 ++ from pip._internal import main ++ except ImportError: ++ # pip 9 ++ from pip import main + if args[0] in ["install", "list", "wheel"]: + args.append('--pre') - return pip.main(args) ++ return main(args) -@@ -88,20 +92,39 @@ def _bootstrap(*, root=None, upgrade=False, user=False, + def version(): +@@ -88,20 +97,39 @@ def _bootstrap(*, root=None, upgrade=False, user=False, # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -222,10 +231,10 @@ index 0000000..753c764 + pass # bad RECORD or empty line + return to_write, to_omit diff --git a/Makefile.pre.in b/Makefile.pre.in -index 51e8132..42b3d29 100644 +index d07b312..1c6720e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1241,7 +1241,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ +@@ -1301,7 +1301,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_asyncio \ collections concurrent concurrent/futures encodings \ email email/mime test/test_email test/test_email/data \ From 611414f20d556b4e9d869aaab25d1794a7000362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 12 May 2018 10:51:09 +0200 Subject: [PATCH 62/67] Bump the bundled pip version to 10.0.1 --- python37.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python37.spec b/python37.spec index a0097d9..e2cf7a3 100644 --- a/python37.spec +++ b/python37.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.17.%{?prerel}%{?dist} +Release: 0.18.%{?prerel}%{?dist} License: Python @@ -616,7 +616,7 @@ Requires: redhat-rpm-config %global __provides_exclude ^python\\(abi\\) = 3\\..$ # We keep those inside on purpose -Provides: bundled(python3-pip) = 9.0.3 +Provides: bundled(python3-pip) = 10.0.1 Provides: bundled(python3-setuptools) = 39.0.1 # The description for the flat package @@ -1565,6 +1565,9 @@ CheckPython optimized # ====================================================== %changelog +* Sat May 12 2018 Miro Hrončok - 3.7.0-0.18.b4 +- Bump the bundled pip version to 10.0.1 + * Thu May 10 2018 Miro Hrončok - 3.7.0-0.17.b4 - Update to 3.7.0b4 From 8fcf2dac2d5dd1a57bcb2213f2b9f4673a7578ce Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Thu, 24 May 2018 18:13:25 +0200 Subject: [PATCH 63/67] Update the bootstrapping sequence --- python37.spec | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/python37.spec b/python37.spec index 3870e66..8d6903a 100644 --- a/python37.spec +++ b/python37.spec @@ -97,15 +97,12 @@ License: Python # 1. At the same time: # - gdb without python support (add %%global _without_python 1 on top of # gdb's SPEC file) -# - python-rpm-generators with bootstrapping_python set to 1 +# - python-rpm-generators # (this can be done also during step 2., but should be done before 3.) # 2. python3 without rewheel (use %%bcond_with rewheel instead of # %%bcond_without) -# 3. At the same time: -# - gdb with python support (remove %%global _without_python 1 on top of -# gdb's SPEC file) -# - python-rpm-generators with bootstrapping_python set to 0 -# (this can be done at any later step without negative effects) +# 3. gdb with python support (remove %%global _without_python 1 on top of +# gdb's SPEC file) # 4. rpm # 5. python-setuptools with bootstrap set to 1 # 6. python-pip with build_wheel set to 0 From bcf8a5d914375e3c2bc00955a6a628baaa26a31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 31 May 2018 10:57:22 +0200 Subject: [PATCH 64/67] Update to 3.7.0b5 --- 00304-test-posix-pass-environ.patch | 13 ------------- python37.spec | 17 +++++------------ sources | 2 +- 3 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 00304-test-posix-pass-environ.patch diff --git a/00304-test-posix-pass-environ.patch b/00304-test-posix-pass-environ.patch deleted file mode 100644 index 9780674..0000000 --- a/00304-test-posix-pass-environ.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py -index da0135b..1b27b5f 100644 ---- a/Lib/test/test_posix.py -+++ b/Lib/test/test_posix.py -@@ -1463,7 +1463,7 @@ class TestPosixSpawn(unittest.TestCase): - """ - pid = posix.posix_spawn(sys.executable, - [sys.executable, '-c', script], -- {'foo': 'bar'}) -+ {**os.environ, 'foo': 'bar'}) - self.assertEqual(os.waitpid(pid, 0), (pid, 0)) - with open(envfile) as f: - self.assertEqual(f.read(), 'bar') diff --git a/python37.spec b/python37.spec index 8d6903a..29e306e 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Third beta -%global prerel b4 +%global prerel b5 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.18.%{?prerel}%{?dist} +Release: 0.19.%{?prerel}%{?dist} License: Python @@ -347,13 +347,6 @@ Patch274: 00274-fix-arch-names.patch # and: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19 Patch291: 00291-setup-Link-ctypes-against-dl-explicitly.patch -# 00304 # -# Pass os.environ to new process created at test_posix::test_specify_environment -# Otherwise important variables such as LD_LIBRARY_PATH are not set and the -# child process might not work at all -# Proposed upstream: https://bugs.python.org/issue33455 -Patch304: 00304-test-posix-pass-environ.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -671,7 +664,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch251 -p1 %patch274 -p1 %patch291 -p1 -%patch304 -p1 # Remove files that should be generated by the build @@ -1226,7 +1218,6 @@ CheckPython optimized %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so %{dynload_dir}/_ssl.%{SOABI_optimized}.so %{dynload_dir}/_struct.%{SOABI_optimized}.so -%{dynload_dir}/_xxsubinterpreters.%{SOABI_optimized}.so %{dynload_dir}/array.%{SOABI_optimized}.so %{dynload_dir}/audioop.%{SOABI_optimized}.so %{dynload_dir}/binascii.%{SOABI_optimized}.so @@ -1490,7 +1481,6 @@ CheckPython optimized %{dynload_dir}/_sqlite3.%{SOABI_debug}.so %{dynload_dir}/_ssl.%{SOABI_debug}.so %{dynload_dir}/_struct.%{SOABI_debug}.so -%{dynload_dir}/_xxsubinterpreters.%{SOABI_debug}.so %{dynload_dir}/array.%{SOABI_debug}.so %{dynload_dir}/audioop.%{SOABI_debug}.so %{dynload_dir}/binascii.%{SOABI_debug}.so @@ -1567,6 +1557,9 @@ CheckPython optimized # ====================================================== %changelog +* Thu May 31 2018 Miro Hrončok - 3.7.0-0.19.b5 +- Update to 3.7.0b5 + * Sat May 12 2018 Miro Hrončok - 3.7.0-0.18.b4 - Bump the bundled pip version to 10.0.1 diff --git a/sources b/sources index abc3c00..67aabf2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0b4.tar.xz) = e97459a5467a984a5a2bfc08ed937dfeb899f3d4ff9a655878badffc19e722efc30112422c14f94fcf9f6c82ee01e9fe2bb538db83454e4c83b711d1a8444472 +SHA512 (Python-3.7.0b5.tar.xz) = 1623df6a250982b070788f47a5a6cc6c2fd6d8e6396cf6926b771abc35e4291bd4532f03e070f8010f17075d5bdb748ce8056ef9e1a2c54e518d58b75481b692 From 63f277fa3ba598c67ff7b3b6e1c78cb462495f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 12 Jun 2018 11:01:05 +0200 Subject: [PATCH 65/67] Update to 3.7.0rc1 --- python37.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python37.spec b/python37.spec index 29e306e..45a9382 100644 --- a/python37.spec +++ b/python37.spec @@ -13,12 +13,12 @@ URL: https://www.python.org/ # Third beta -%global prerel b5 +%global prerel rc1 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.0 -Release: 0.19.%{?prerel}%{?dist} +Release: 0.20.%{?prerel}%{?dist} License: Python @@ -1557,6 +1557,9 @@ CheckPython optimized # ====================================================== %changelog +* Tue Jun 12 2018 Miro Hrončok - 3.7.0-0.20.rc1 +- Update to 3.7.0rc1 + * Thu May 31 2018 Miro Hrončok - 3.7.0-0.19.b5 - Update to 3.7.0b5 diff --git a/sources b/sources index 67aabf2..8ed12d6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.0b5.tar.xz) = 1623df6a250982b070788f47a5a6cc6c2fd6d8e6396cf6926b771abc35e4291bd4532f03e070f8010f17075d5bdb748ce8056ef9e1a2c54e518d58b75481b692 +SHA512 (Python-3.7.0rc1.tar.xz) = cc4c29dfce7e2fca6328f802bd435e1ffc4acecd70d83d602a894bf076bdb95fb4635c891043ba1c3b6438d23ba7f76545cfe323ec0b57029b5c0f639fc6d2c5 From ceff4b88709b01fc3c12cbd18f23353bdda7a34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 12 Jun 2018 11:47:27 +0200 Subject: [PATCH 66/67] Add 3394 magic number to rpmlintrc --- python37.rpmlintrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python37.rpmlintrc b/python37.rpmlintrc index f91b865..6c1ce83 100644 --- a/python37.rpmlintrc +++ b/python37.rpmlintrc @@ -45,6 +45,8 @@ addFilter(r'obsolete-not-provided platform-python') # RPMLINT IMPERFECTIONS # https://github.com/rpm-software-management/rpmlint/issues/123 addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found 3393') +# https://github.com/rpm-software-management/rpmlint/pull/133 +addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found 3394') # https://bugzilla.redhat.com/show_bug.cgi?id=1550562 # https://github.com/rpm-software-management/rpmlint/issues/128 From de441a2d3a149709d37d4a49e93caf82f7190d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 12 Jun 2018 12:42:28 +0200 Subject: [PATCH 67/67] Fix prerel comment --- python37.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python37.spec b/python37.spec index 45a9382..93dbbea 100644 --- a/python37.spec +++ b/python37.spec @@ -12,7 +12,7 @@ Summary: Version %{pybasever} of the Python interpreter URL: https://www.python.org/ -# Third beta +# First rc %global prerel rc1 # WARNING When rebasing to a new Python version,