#56 f31 importpatches & CVE-2020-26116
Merged 3 years ago by pviktori. Opened 3 years ago by pviktori.
rpms/ pviktori/python2 f31  into  f31

file modified
+20 -5
@@ -1,7 +1,22 @@ 

- diff -up Python-2.7.3/Lib/pydoc.py.no_gui Python-2.7.3/Lib/pydoc.py

- --- Python-2.7.3/Lib/pydoc.py.no_gui	2012-04-09 19:07:31.000000000 -0400

- +++ Python-2.7.3/Lib/pydoc.py	2013-02-19 13:48:44.480054515 -0500

- @@ -19,9 +19,6 @@ of all available modules.

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:12:37 +0200

+ Subject: [PATCH] 00001-pydocnogui.patch

+ 

+ Removes the "-g" option from "pydoc", for some reason; I believe

+ (dmalcolm 2010-01-29) that this was introduced in this change:

+ - fix pydoc (#68082)

+ in 2.2.1-12 as a response to the -g option needing TkInter installed

+ (Red Hat Linux 8)

+ ---

+  Lib/pydoc.py | 8 +-------

+  1 file changed, 1 insertion(+), 7 deletions(-)

+ 

+ diff --git a/Lib/pydoc.py b/Lib/pydoc.py

+ index 62cc262ccb8..4ffc8f000e5 100755

+ --- a/Lib/pydoc.py

+ +++ b/Lib/pydoc.py

+ @@ -20,9 +20,6 @@ Run "pydoc -p <port>" to start an HTTP server on a given port on the

   local machine to generate documentation web pages.  Port number 0 can be

   used to get an arbitrary unused port.

   
@@ -11,7 +26,7 @@ 

   Run "pydoc -w <name>" to write out the HTML documentation for a module

   to a file named "<name>.html".

   

- @@ -2346,13 +2340,10 @@ def cli():

+ @@ -2404,13 +2401,10 @@ def cli():

       Start an HTTP server on the given port on the local machine.  Port

       number 0 can be used to get an arbitrary unused port.

   

@@ -1,5 +1,19 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:16:05 +0200

+ Subject: [PATCH] 00010-2.7.13-binutils-no-dep.patch

+ 

+ FIXME: Lib/ctypes/util.py posix implementation defines a function

+ _get_soname(f).  Upstreams's implementation of this uses objdump to read the

+ SONAME from a library; we avoid this, apparently to minimize space

+ requirements on the live CD:

+ (rhbz:307221)

+ ---

+  Lib/ctypes/util.py | 6 +++++-

+  1 file changed, 5 insertions(+), 1 deletion(-)

+ 

  diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py

- index ab10ec5..923d1b7 100644

+ index ab10ec52ee8..923d1b72714 100644

  --- a/Lib/ctypes/util.py

  +++ b/Lib/ctypes/util.py

  @@ -140,11 +140,15 @@ elif os.name == "posix":

file modified
+96 -70
@@ -1,48 +1,28 @@ 

- diff -up Python-2.7rc1/configure.ac.systemtap Python-2.7rc1/configure.ac

- --- Python-2.7rc1/configure.ac.systemtap	2010-06-06 10:53:15.514975012 -0400

- +++ Python-2.7rc1/configure.ac	2010-06-06 10:53:15.520974361 -0400

- @@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then

-      )

-  fi

-  

- +# Check for dtrace support

- +AC_MSG_CHECKING(for --with-dtrace)

- +AC_ARG_WITH(dtrace,

- +            AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))

- +

- +if test ! -z "$with_dtrace"

- +then

- +    if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null

- +    then

- +	AC_DEFINE(WITH_DTRACE, 1, 

- +	 [Define if you want to compile in Dtrace support])

- +	with_dtrace="Sun"

- +	DTRACEOBJS="Python/dtrace.o"

- +	DTRADEHDRS=""

- +    elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d

- +    then

- +	AC_DEFINE(WITH_DTRACE, 1, 

- +	 [Define if you want to compile in Dtrace support])

- +	with_dtrace="Apple"

- +	DTRACEOBJS=""

- +	DTRADEHDRS="pydtrace.h"

- +    else

- +	with_dtrace="no"

- +    fi

- +else

- +    with_dtrace="no"

- +fi

- +

- +AC_MSG_RESULT($with_dtrace)

- +AC_SUBST(DTRACEOBJS)

- +AC_SUBST(DTRACEHDRS)

- +

-  # Check for --with-wctype-functions

-  AC_MSG_CHECKING(for --with-wctype-functions)

-  AC_ARG_WITH(wctype-functions, 

- diff -up Python-2.7rc1/Include/pydtrace.d.systemtap Python-2.7rc1/Include/pydtrace.d

- --- Python-2.7rc1/Include/pydtrace.d.systemtap	2010-06-06 10:53:15.520974361 -0400

- +++ Python-2.7rc1/Include/pydtrace.d	2010-06-06 10:53:15.520974361 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:18:18 +0200

+ Subject: [PATCH] 00055-systemtap.patch

+ 

+ 00055 #

+ Systemtap support: add statically-defined probe points

+ Patch based on upstream bug: http://bugs.python.org/issue4111

+ fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4

+ then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted

+ for 2.7rc1 by dmalcolm:

+ ---

+  Include/pydtrace.d | 10 ++++++++

+  Makefile.pre.in    | 15 +++++++++++-

+  Python/ceval.c     | 59 ++++++++++++++++++++++++++++++++++++++++++++++

+  configure.ac       | 32 +++++++++++++++++++++++++

+  pyconfig.h.in      |  3 +++

+  5 files changed, 118 insertions(+), 1 deletion(-)

+  create mode 100644 Include/pydtrace.d

+ 

+ diff --git a/Include/pydtrace.d b/Include/pydtrace.d

+ new file mode 100644

+ index 00000000000..3aedc4ce2f8

+ --- /dev/null

+ +++ b/Include/pydtrace.d

  @@ -0,0 +1,10 @@

  +provider python {

  +	probe function__entry(const char *, const char *, int);
@@ -54,10 +34,11 @@ 

  +#pragma D attributes Private/Private/Common provider python function

  +#pragma D attributes Evolving/Evolving/Common provider python name

  +#pragma D attributes Evolving/Evolving/Common provider python args

- diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in

- --- Python-2.7rc1/Makefile.pre.in.systemtap	2010-06-06 10:53:15.488978775 -0400

- +++ Python-2.7rc1/Makefile.pre.in	2010-06-06 11:05:30.411100568 -0400

- @@ -298,6 +298,7 @@ PYTHON_OBJS=	\

+ diff --git a/Makefile.pre.in b/Makefile.pre.in

+ index 24b9d40143f..0e6246ae055 100644

+ --- a/Makefile.pre.in

+ +++ b/Makefile.pre.in

+ @@ -337,6 +337,7 @@ PYTHON_OBJS=	\

   		Python/formatter_unicode.o \

   		Python/formatter_string.o \

   		Python/$(DYNLOADFILE) \
@@ -65,7 +46,7 @@ 

   		$(LIBOBJS) \

   		$(MACHDEP_OBJS) \

   		$(THREADOBJ)

- @@ -599,6 +600,18 @@ Python/formatter_unicode.o: $(srcdir)/Py

+ @@ -748,6 +749,18 @@ Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \

   Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \

   				$(STRINGLIB_HEADERS)

   
@@ -84,7 +65,7 @@ 

   ############################################################################

   # Header files

   

- @@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@

+ @@ -1492,7 +1505,7 @@ Python/thread.o: @THREADHEADERS@

   .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure

   .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools

   .PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
@@ -93,22 +74,10 @@ 

   .PHONY: gdbhooks

   

   # IF YOU PUT ANYTHING HERE IT WILL GO AWAY

- diff -up Python-2.7rc1/pyconfig.h.in.systemtap Python-2.7rc1/pyconfig.h.in

- --- Python-2.7rc1/pyconfig.h.in.systemtap	2010-05-08 07:04:18.000000000 -0400

- +++ Python-2.7rc1/pyconfig.h.in	2010-06-06 10:53:15.521974070 -0400

- @@ -1074,6 +1074,9 @@

-  /* Define if you want documentation strings in extension modules */

-  #undef WITH_DOC_STRINGS

-  

- +/* Define if you want to compile in Dtrace support */

- +#undef WITH_DTRACE

- +

-  /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic

-     linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).

-     Dyld is necessary to support frameworks. */

- diff -up Python-2.7rc1/Python/ceval.c.systemtap Python-2.7rc1/Python/ceval.c

- --- Python-2.7rc1/Python/ceval.c.systemtap	2010-05-09 10:46:46.000000000 -0400

- +++ Python-2.7rc1/Python/ceval.c	2010-06-06 11:08:40.683100500 -0400

+ diff --git a/Python/ceval.c b/Python/ceval.c

+ index e1140a8e401..b7427f9658c 100644

+ --- a/Python/ceval.c

+ +++ b/Python/ceval.c

  @@ -19,6 +19,10 @@

   

   #include <ctype.h>
@@ -120,7 +89,7 @@ 

   #ifndef WITH_TSC

   

   #define READ_TIMESTAMP(var)

- @@ -671,6 +675,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje

+ @@ -674,6 +678,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)

                         NULL);

   }

   
@@ -176,7 +145,7 @@ 

   

   /* Interpreter main loop */

   

- @@ -909,6 +962,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int

+ @@ -1021,6 +1074,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)

           }

       }

   
@@ -186,7 +155,7 @@ 

       co = f->f_code;

       names = co->co_names;

       consts = co->co_consts;

- @@ -3000,6 +3056,9 @@ fast_yield:

+ @@ -3357,6 +3413,9 @@ fast_yield:

   

       /* pop frame */

   exit_eval_frame:
@@ -196,3 +165,60 @@ 

       Py_LeaveRecursiveCall();

       tstate->frame = f->f_back;

   

+ diff --git a/configure.ac b/configure.ac

+ index 5930552a4c4..3e28b81eaf5 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -3052,6 +3052,38 @@ if test "$with_valgrind" != no; then

+      )

+  fi

+  

+ +# Check for dtrace support

+ +AC_MSG_CHECKING(for --with-dtrace)

+ +AC_ARG_WITH(dtrace,

+ +            AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))

+ +

+ +if test ! -z "$with_dtrace"

+ +then

+ +    if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null

+ +    then

+ +	AC_DEFINE(WITH_DTRACE, 1, 

+ +	 [Define if you want to compile in Dtrace support])

+ +	with_dtrace="Sun"

+ +	DTRACEOBJS="Python/dtrace.o"

+ +	DTRADEHDRS=""

+ +    elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d

+ +    then

+ +	AC_DEFINE(WITH_DTRACE, 1, 

+ +	 [Define if you want to compile in Dtrace support])

+ +	with_dtrace="Apple"

+ +	DTRACEOBJS=""

+ +	DTRADEHDRS="pydtrace.h"

+ +    else

+ +	with_dtrace="no"

+ +    fi

+ +else

+ +    with_dtrace="no"

+ +fi

+ +

+ +AC_MSG_RESULT($with_dtrace)

+ +AC_SUBST(DTRACEOBJS)

+ +AC_SUBST(DTRACEHDRS)

+ +

+  # Check for --with-wctype-functions

+  AC_MSG_CHECKING(for --with-wctype-functions)

+  AC_ARG_WITH(wctype-functions, 

+ diff --git a/pyconfig.h.in b/pyconfig.h.in

+ index 4da6e7104ab..652279857ef 100644

+ --- a/pyconfig.h.in

+ +++ b/pyconfig.h.in

+ @@ -1145,6 +1145,9 @@

+  /* Define if you want documentation strings in extension modules */

+  #undef WITH_DOC_STRINGS

+  

+ +/* Define if you want to compile in Dtrace support */

+ +#undef WITH_DTRACE

+ +

+  /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic

+     linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).

+     Dyld is necessary to support frameworks. */

file modified
+37 -16
@@ -1,5 +1,26 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:18:37 +0200

+ Subject: [PATCH] 00102-2.7.13-lib64.patch

+ 

+ Only used when "%%{_lib}" == "lib64"

+ Fixup various paths throughout the build and in distutils from "lib" to "lib64",

+ and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of

+ /usr/lib/pythonMAJOR.MINOR/site-packages

+ Not upstream

+ ---

+  Lib/distutils/command/install.py |  4 ++--

+  Lib/distutils/sysconfig.py       |  6 +++++-

+  Lib/site.py                      |  4 ++++

+  Lib/test/test_site.py            | 11 +++++++----

+  Makefile.pre.in                  |  2 +-

+  Modules/Setup.dist               |  6 +++---

+  Modules/getpath.c                |  4 ++--

+  setup.py                         | 10 +++++-----

+  8 files changed, 29 insertions(+), 18 deletions(-)

+ 

  diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py

- index b9f1c6c..7b23714 100644

+ index b9f1c6c566f..7b237149335 100644

  --- a/Lib/distutils/command/install.py

  +++ b/Lib/distutils/command/install.py

  @@ -42,14 +42,14 @@ else:
@@ -20,10 +41,10 @@ 

           'scripts': '$base/bin',

           'data'   : '$base',

  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py

- index 031f809..ec5d584 100644

+ index 1a4b7926441..a485419a7e5 100644

  --- a/Lib/distutils/sysconfig.py

  +++ b/Lib/distutils/sysconfig.py

- @@ -120,8 +120,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":
@@ -38,7 +59,7 @@ 

               return libpython

           else:

  diff --git a/Lib/site.py b/Lib/site.py

- index c360802..868b7cb 100644

+ index 3b51e81d4a1..9fd76c8157a 100644

  --- a/Lib/site.py

  +++ b/Lib/site.py

  @@ -288,12 +288,16 @@ def getsitepackages():
@@ -59,7 +80,7 @@ 

       return sitepackages

   

  diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py

- index b4384ee..349f688 100644

+ index b4384ee2cf8..349f6885655 100644

  --- a/Lib/test/test_site.py

  +++ b/Lib/test/test_site.py

  @@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase):
@@ -72,11 +93,11 @@ 

  +            wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3],

                                     'site-packages')

               self.assertEqual(dirs[0], wanted)

- -            wanted = os.path.join('xoxo', 'lib', 'site-python')

  +            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],

  +                                   'site-packages')

-              self.assertEqual(dirs[1], wanted)

- +            wanted = os.path.join('xoxo', 'lib', 'site-python')

+ +            self.assertEqual(dirs[1], wanted)

+              wanted = os.path.join('xoxo', 'lib', 'site-python')

+ -            self.assertEqual(dirs[1], wanted)

  +            self.assertEqual(dirs[2], wanted)

           else:

               # other platforms
@@ -88,7 +109,7 @@ 

   

       def test_no_home_directory(self):

  diff --git a/Makefile.pre.in b/Makefile.pre.in

- index 4f59dd3..877698c 100644

+ index 0e6246ae055..3be3b535d3c 100644

  --- a/Makefile.pre.in

  +++ b/Makefile.pre.in

  @@ -110,7 +110,7 @@ LIBDIR=		@libdir@
@@ -101,7 +122,7 @@ 

   # Detailed destination directories

   BINLIBDEST=	$(LIBDIR)/python$(VERSION)

  diff --git a/Modules/Setup.dist b/Modules/Setup.dist

- index 2cf35a9..c4c88cb 100644

+ index 2cf35a9640d..c4c88cbf964 100644

  --- a/Modules/Setup.dist

  +++ b/Modules/Setup.dist

  @@ -231,7 +231,7 @@ crypt cryptmodule.c # -lcrypt	# crypt(3); needs -lcrypt on some systems
@@ -132,7 +153,7 @@ 

   # Interface to the Expat XML parser

   # More information on Expat can be found at www.libexpat.org.

  diff --git a/Modules/getpath.c b/Modules/getpath.c

- index fd33a01..c5c86fd 100644

+ index 092ccc712f9..20d1779d937 100644

  --- a/Modules/getpath.c

  +++ b/Modules/getpath.c

  @@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
@@ -144,7 +165,7 @@ 

   

   static void

   reduce(char *dir)

- @@ -548,7 +548,7 @@ calculate_path(void)

+ @@ -530,7 +530,7 @@ calculate_path(void)

               fprintf(stderr,

                   "Could not find platform dependent libraries <exec_prefix>\n");

           strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
@@ -154,10 +175,10 @@ 

       /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */

   

  diff --git a/setup.py b/setup.py

- index 0288a6b..7905f6f 100644

+ index f764223d062..ca48b11c278 100644

  --- a/setup.py

  +++ b/setup.py

- @@ -456,7 +456,7 @@ class PyBuildExt(build_ext):

+ @@ -502,7 +502,7 @@ class PyBuildExt(build_ext):

       def detect_modules(self):

           # Ensure that /usr/local is always used

           if not cross_compiling:
@@ -166,7 +187,7 @@ 

               add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')

           if cross_compiling:

               self.add_gcc_paths()

- @@ -782,11 +782,11 @@ class PyBuildExt(build_ext):

+ @@ -828,11 +828,11 @@ class PyBuildExt(build_ext):

               elif curses_library:

                   readline_libs.append(curses_library)

               elif self.compiler.find_library_file(lib_dirs +
@@ -180,7 +201,7 @@ 

                                      extra_link_args=readline_extra_link_args,

                                      libraries=readline_libs) )

           else:

- @@ -821,8 +821,8 @@ class PyBuildExt(build_ext):

+ @@ -867,8 +867,8 @@ class PyBuildExt(build_ext):

               if krb5_h:

                   ssl_incs += krb5_h

           ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,

@@ -1,6 +1,20 @@ 

- --- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64	2011-09-08 17:51:57.851405376 -0400

- +++ Python-2.7.2/Lib/distutils/tests/test_install.py	2011-09-08 18:40:46.754205096 -0400

- @@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:19:19 +0200

+ Subject: [PATCH] 00104-lib64-fix-for-test_install.patch

+ 

+ 00104 #

+ Only used when "%%{_lib}" == "lib64"

+ Another lib64 fix, for distutils/tests/test_install.py; not upstream:

+ ---

+  Lib/distutils/tests/test_install.py | 3 ++-

+  1 file changed, 2 insertions(+), 1 deletion(-)

+ 

+ diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py

+ index 397e2a7d4bb..c72ae0b6cdb 100644

+ --- a/Lib/distutils/tests/test_install.py

+ +++ b/Lib/distutils/tests/test_install.py

+ @@ -58,8 +58,9 @@ class InstallTestCase(support.TempdirManager,

               self.assertEqual(got, expected)

   

           libdir = os.path.join(destination, "lib", "python")

file modified
+20 -6
@@ -1,7 +1,21 @@ 

- diff -up Python-2.7.6/Makefile.pre.in.no-static-lib Python-2.7.6/Makefile.pre.in

- --- Python-2.7.6/Makefile.pre.in.no-static-lib	2014-01-29 13:58:32.933226720 +0100

- +++ Python-2.7.6/Makefile.pre.in	2014-01-29 14:10:25.002247272 +0100

- @@ -437,7 +437,7 @@ coverage:

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:19:34 +0200

+ Subject: [PATCH] 00111-no-static-lib.patch

+ 

+ 00111 #

+ Patch the Makefile.pre.in so that the generated Makefile doesn't try to build

+ a libpythonMAJOR.MINOR.a (bug 550692):

+ Downstream only: not appropriate for upstream

+ ---

+  Makefile.pre.in | 26 +-------------------------

+  1 file changed, 1 insertion(+), 25 deletions(-)

+ 

+ diff --git a/Makefile.pre.in b/Makefile.pre.in

+ index 3be3b535d3c..370c8fecebf 100644

+ --- a/Makefile.pre.in

+ +++ b/Makefile.pre.in

+ @@ -487,7 +487,7 @@ coverage-report: regen-grammar

   

   

   # Build the interpreter
@@ -10,7 +24,7 @@ 

   		$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \

   			Modules/python.o \

   			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

- @@ -464,18 +464,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx

+ @@ -528,18 +528,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o

   		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \

   		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build

   
@@ -29,7 +43,7 @@ 

   libpython$(VERSION).so: $(LIBRARY_OBJS)

   	if test $(INSTSONAME) != $(LDLIBRARY); then \

   		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \

- @@ -1097,18 +1085,6 @@ libainstall:	all python-config

+ @@ -1229,18 +1217,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config

   		else	true; \

   		fi; \

   	done

file modified
+97 -41
@@ -1,25 +1,83 @@ 

- From 898f93aa206e577dfe854c59bc62d0cea09cd5ed Mon Sep 17 00:00:00 2001

- From: Tomas Orsava <torsava@redhat.com>

- Date: Tue, 10 Jan 2017 16:19:50 +0100

- Subject: [PATCH] Patch to support building both optimized vs debug stacks DSO

-  ABIs,

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:19:56 +0200

+ Subject: [PATCH] 00112-2.7.13-debug-build.patch

  

- sharing the same .py and .pyc files, using "_d.so" to signify a debug build of

- an extension module.

+ 00112 #

+ Patch to support building both optimized vs debug stacks DSO ABIs, sharing

+ the same .py and .pyc files, using "_d.so" to signify a debug build of an

+ extension module.

+ 

+ Based on Debian's patch for the same,

+  http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug-build.dpatch

+ 

+ (which was itself based on the upstream Windows build), but with some

+ changes:

+ 

+   * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,

+ but this can potentially find a module built against the wrong DSO ABI.  We

+ instead search for just module_d.so in a debug build

+ 

+   * We remove this change from configure.in's build of the Makefile:

+   SO=$DEBUG_EXT.so

+ so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'

+ on debug builds, so that UnixCCompiler.find_library_file can find system

+ libraries (otherwise "make sharedlibs" fails to find system libraries,

+ erroneously looking e.g. for "libffi_d.so" rather than "libffi.so")

+ 

+   * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename

+ to add the _d there, when building an extension.  This way, "make sharedlibs"

+ can build ctypes, by finding the sysmtem libffi.so (rather than failing to

+ find "libffi_d.so"), and builds the module as _ctypes_d.so

+ 

+   * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by

+ appending "_d" to the python library's name for the debug configuration

+ 

+   * We modify Modules/makesetup to add the "_d" to the generated Makefile

+ rules for the various Modules/*.so targets

+ 

+ This may introduce issues when building an extension that links directly

+ against another extension (e.g. users of NumPy?), but seems more robust when

+ searching for external libraries

+ 

+   * We don't change Lib/distutils/command/build.py: build.build_purelib to

+ embed plat_specifier, leaving it as is, as pure python builds should be

+ unaffected by these differences (we'll be sharing the .py and .pyc files)

+ 

+   * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:

+     - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for

+ a debug build

+     - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a

+ debug build

+ 

+   Both will be empty in an optimized build.  "_d" contains characters that

+ are valid ELF metadata, but this leads to various ugly filesystem paths (such

+ as the include path), and DEBUG_SUFFIX allows these paths to have more natural

+ names.  Changing this requires changes elsewhere in the distutils code.

+ 

+   * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two

+ configurations build parallel-installable binaries with different names

+ ("python-debug" vs "python").

+ 

+   * Similarly, we add DEBUG_SUFFIX within python-config and

+  python$(VERSION)-config, so that the two configuration get different paths

+  for these.

+ 

+  See also patch 130 below

  ---

-  Lib/distutils/command/build_ext.py  |  7 ++++-

-  Lib/distutils/sysconfig.py          |  5 ++--

+  Lib/distutils/command/build_ext.py  |  7 +++-

+  Lib/distutils/sysconfig.py          |  5 +--

   Lib/distutils/tests/test_install.py |  3 +-

-  Makefile.pre.in                     | 56 ++++++++++++++++++++-----------------

+  Makefile.pre.in                     | 56 ++++++++++++++++-------------

   Misc/python-config.in               |  2 +-

   Modules/makesetup                   |  2 +-

-  Python/dynload_shlib.c              | 11 ++++++--

+  Python/dynload_shlib.c              | 11 ++++--

   Python/sysmodule.c                  |  6 ++++

-  configure.ac                        | 14 ++++++++--

+  configure.ac                        | 14 ++++++--

   9 files changed, 69 insertions(+), 37 deletions(-)

  

  diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py

- index 2c68be3..029d144 100644

+ index 86a85c1a0a0..086b2b72c3a 100644

  --- a/Lib/distutils/command/build_ext.py

  +++ b/Lib/distutils/command/build_ext.py

  @@ -677,7 +677,10 @@ class build_ext (Command):
@@ -44,10 +102,10 @@ 

               else:

                   return ext.libraries

  diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py

- index 3e7f077..ec5d584 100644

+ index a485419a7e5..079a480eca4 100644

  --- a/Lib/distutils/sysconfig.py

  +++ b/Lib/distutils/sysconfig.py

- @@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None):

+ @@ -100,7 +100,8 @@ def get_python_inc(plat_specific=0, prefix=None):

                   # Include is located in the srcdir

                   inc_dir = os.path.join(srcdir, "Include")

               return inc_dir
@@ -57,7 +115,7 @@ 

       elif os.name == "nt":

           return os.path.join(prefix, "include")

       elif os.name == "os2":

- @@ -248,7 +249,7 @@ def get_makefile_filename():

+ @@ -258,7 +259,7 @@ def get_makefile_filename():

       if python_build:

           return os.path.join(project_base, "Makefile")

       lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
@@ -67,7 +125,7 @@ 

   

   def parse_config_h(fp, g=None):

  diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py

- index 78fac46..d1d0931 100644

+ index c72ae0b6cdb..8ec2111ab75 100644

  --- a/Lib/distutils/tests/test_install.py

  +++ b/Lib/distutils/tests/test_install.py

  @@ -20,8 +20,9 @@ from distutils.tests import support
@@ -82,10 +140,10 @@ 

   

   

  diff --git a/Makefile.pre.in b/Makefile.pre.in

- index 997a2fc..467e782 100644

+ index 370c8fecebf..1e20682a699 100644

  --- a/Makefile.pre.in

  +++ b/Makefile.pre.in

- @@ -116,8 +116,8 @@ SCRIPTDIR=	$(prefix)/lib64

+ @@ -115,8 +115,8 @@ SCRIPTDIR=	$(prefix)/lib64

   # Detailed destination directories

   BINLIBDEST=	$(LIBDIR)/python$(VERSION)

   LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
@@ -96,7 +154,7 @@ 

   LIBP=		$(LIBDIR)/python$(VERSION)

   

   # Symbols used for using shared libraries

- @@ -131,6 +131,12 @@ DESTSHARED=	$(BINLIBDEST)/lib-dynload

+ @@ -130,6 +130,12 @@ DESTSHARED=	$(BINLIBDEST)/lib-dynload

   EXE=		@EXEEXT@

   BUILDEXE=	@BUILDEXEEXT@

   
@@ -109,7 +167,7 @@ 

   # Short name and location for Mac OS X Python framework

   UNIVERSALSDK=@UNIVERSALSDK@

   PYTHONFRAMEWORK=	@PYTHONFRAMEWORK@

- @@ -197,8 +203,8 @@ LIBOBJDIR=	Python/

+ @@ -196,8 +202,8 @@ LIBOBJDIR=	Python/

   LIBOBJS=	@LIBOBJS@

   UNICODE_OBJS=   @UNICODE_OBJS@

   
@@ -120,7 +178,7 @@ 

   

   PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@

   PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@

- @@ -547,7 +553,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o

+ @@ -528,7 +534,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o

   		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \

   		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build

   
@@ -129,7 +187,7 @@ 

   	if test $(INSTSONAME) != $(LDLIBRARY); then \

   		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \

   		$(LN) -f $(INSTSONAME) $@; \

- @@ -954,18 +960,18 @@ bininstall:	altbininstall

+ @@ -983,18 +989,18 @@ bininstall:	altbininstall

   	then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \

   	else true; \

   	fi
@@ -159,7 +217,7 @@ 

   

   # Install the interpreter with $(VERSION) affixed

   # This goes into $(exec_prefix)

- @@ -978,7 +984,7 @@ altbininstall:	$(BUILDPYTHON)

+ @@ -1007,7 +1013,7 @@ altbininstall:	$(BUILDPYTHON)

   		else	true; \

   		fi; \

   	done
@@ -168,7 +226,7 @@ 

   	if test -f $(LDLIBRARY); then \

   		if test -n "$(DLLLIBRARY)" ; then \

   			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \

- @@ -1148,10 +1154,11 @@ $(srcdir)/Lib/$(PLATDIR):

+ @@ -1178,10 +1184,11 @@ $(srcdir)/Lib/$(PLATDIR):

   	fi; \

   	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen

   
@@ -182,7 +240,7 @@ 

   

   # Install the include files

   INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)

- @@ -1172,13 +1179,13 @@ inclinstall:

+ @@ -1202,13 +1209,13 @@ inclinstall:

   	$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h

   

   # Install the library and miscellaneous stuff needed for extending/embedding
@@ -199,7 +257,7 @@ 

   	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \

   	do \

   		if test ! -d $(DESTDIR)$$i; then \

- @@ -1194,11 +1201,10 @@ libainstall:	all python-config

+ @@ -1224,11 +1231,10 @@ libainstall:	@DEF_MAKE_RULE@ python-config

   	$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup

   	$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local

   	$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
@@ -214,7 +272,7 @@ 

   		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \

   		echo; echo "Installing support files for building shared extension modules on AIX:"; \

  diff --git a/Misc/python-config.in b/Misc/python-config.in

- index a09e07c..c1691ef 100644

+ index 9ee0fdff48a..896c849f061 100644

  --- a/Misc/python-config.in

  +++ b/Misc/python-config.in

  @@ -44,7 +44,7 @@ for opt in opt_flags:
@@ -227,7 +285,7 @@ 

           libs += getvar('SYSLIBS').split()

           # add the prefix/lib/pythonX.Y/config dir, but only if there is no

  diff --git a/Modules/makesetup b/Modules/makesetup

- index 1bffcbf..f0bc743 100755

+ index db5c47ee04d..e6ddaba68d4 100755

  --- a/Modules/makesetup

  +++ b/Modules/makesetup

  @@ -233,7 +233,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
@@ -240,17 +298,18 @@ 

   			no)	SHAREDMODS="$SHAREDMODS $file";;

   			esac

  diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c

- index 17ebab1..02a94aa 100644

+ index 17ebab16bad..02a94aa1854 100644

  --- a/Python/dynload_shlib.c

  +++ b/Python/dynload_shlib.c

- @@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {

+ @@ -45,12 +45,17 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {

+      {".EXE", "rb", C_EXTENSION},

       {"module.exe", "rb", C_EXTENSION},

       {"MODULE.EXE", "rb", C_EXTENSION},

-  #else

+ +#else

  +#ifdef Py_DEBUG

  +    {"_d.so", "rb", C_EXTENSION},

  +    {"module_d.so", "rb", C_EXTENSION},

- +#else

+  #else

       {".so", "rb", C_EXTENSION},

       {"module.so", "rb", C_EXTENSION},

  -#endif
@@ -264,7 +323,7 @@ 

   };

   

  diff --git a/Python/sysmodule.c b/Python/sysmodule.c

- index aeff38a..183e3cc 100644

+ index fdb7af2f5f6..22238ba8ce4 100644

  --- a/Python/sysmodule.c

  +++ b/Python/sysmodule.c

  @@ -1524,6 +1524,12 @@ _PySys_Init(void)
@@ -281,10 +340,10 @@ 

       if (PyErr_Occurred())

           return NULL;

  diff --git a/configure.ac b/configure.ac

- index 0a902c7..5caedb7 100644

+ index 3e28b81eaf5..19925ce2c6f 100644

  --- a/configure.ac

  +++ b/configure.ac

- @@ -764,7 +764,7 @@ AC_SUBST(LIBRARY)

+ @@ -778,7 +778,7 @@ AC_SUBST(LIBRARY)

   AC_MSG_CHECKING(LIBRARY)

   if test -z "$LIBRARY"

   then
@@ -293,7 +352,7 @@ 

   fi

   AC_MSG_RESULT($LIBRARY)

   

- @@ -910,8 +910,8 @@ if test $enable_shared = "yes"; then

+ @@ -924,8 +924,8 @@ if test $enable_shared = "yes"; then

   	  INSTSONAME="$LDLIBRARY".$SOVERSION

             ;;

       Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
@@ -304,7 +363,7 @@ 

   	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

   	  case $ac_sys_system in

   	      FreeBSD*)

- @@ -1040,6 +1040,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'

+ @@ -1051,6 +1051,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'

   fi],

   [AC_MSG_RESULT(no)])

   
@@ -319,6 +378,3 @@ 

   # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be

   # merged with this chunk of code?

   

- -- 

- 2.11.0

- 

@@ -1,7 +1,24 @@ 

- diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac

- --- Python-2.6.5/configure.ac.more-configuration-flags	2010-05-24 18:51:25.410111792 -0400

- +++ Python-2.6.5/configure.ac	2010-05-24 18:59:23.954986388 -0400

- @@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:20:52 +0200

+ Subject: [PATCH] 00113-more-configuration-flags.patch

+ 

+ 00113 #

+ Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options

+ described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt

+ so that if they are enabled, they will be in that build's pyconfig.h, so that

+ extension modules will reliably use them

+ Not yet sent upstream

+ ---

+  configure.ac  | 24 ++++++++++++++++++++++++

+  pyconfig.h.in |  6 ++++++

+  2 files changed, 30 insertions(+)

+ 

+ diff --git a/configure.ac b/configure.ac

+ index 19925ce2c6f..e0bc200cf85 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -3032,6 +3032,30 @@ else AC_MSG_RESULT(no)

   fi],

   [AC_MSG_RESULT(no)])

   
@@ -32,10 +49,11 @@ 

   # Check for Python-specific malloc support

   AC_MSG_CHECKING(for --with-pymalloc)

   AC_ARG_WITH(pymalloc,

- diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in

- --- Python-2.6.5/pyconfig.h.in.more-configuration-flags	2010-05-24 18:51:45.677988086 -0400

- +++ Python-2.6.5/pyconfig.h.in	2010-05-24 19:00:44.163987730 -0400

- @@ -1019,6 +1019,12 @@

+ diff --git a/pyconfig.h.in b/pyconfig.h.in

+ index 652279857ef..a81dc34c693 100644

+ --- a/pyconfig.h.in

+ +++ b/pyconfig.h.in

+ @@ -1169,6 +1169,12 @@

   /* Define to profile with the Pentium timestamp counter */

   #undef WITH_TSC

   

@@ -1,7 +1,21 @@ 

- diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants Python-2.7rc1/Modules/posixmodule.c

- --- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants	2010-05-15 17:45:30.000000000 -0400

- +++ Python-2.7rc1/Modules/posixmodule.c	2010-06-07 22:54:16.162068624 -0400

- @@ -9174,6 +9174,43 @@ all_ins(PyObject *d)

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:21:09 +0200

+ Subject: [PATCH] 00114-statvfs-f_flag-constants.patch

+ 

+ 00114 #

+ Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")

+ (rhbz:553020); partially upstream as http://bugs.python.org/issue7647

+ Not yet sent upstream

+ ---

+  Modules/posixmodule.c | 37 +++++++++++++++++++++++++++++++++++++

+  1 file changed, 37 insertions(+)

+ 

+ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c

+ index 7a1a6945c10..25ce36d4876 100644

+ --- a/Modules/posixmodule.c

+ +++ b/Modules/posixmodule.c

+ @@ -9457,6 +9457,43 @@ all_ins(PyObject *d)

   #endif

   #endif

   

@@ -1,6 +1,30 @@ 

- --- Python-2.7.5/Lib/site.py.orig	2013-05-16 12:47:55.000000000 +0200

- +++ Python-2.7.5/Lib/site.py	2013-05-16 12:56:20.089058109 +0200

- @@ -529,6 +529,10 @@ def main():

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:21:28 +0200

+ Subject: [PATCH] 00121-add-Modules-to-build-path.patch

+ 

+ Upstream r79310 removed the "Modules" directory from sys.path when Python is

+ running from the build directory on POSIX to fix a unit test (issue #8205).

+ This seems to have broken the compileall.py done in "make install": it cannot

+ find shared library extension modules at this point in the build (sys.path

+ does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),

+ leading to the build failing with:

+ Traceback (most recent call last):

+   File "/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py", line 17, in <module>

+     import struct

+   File "/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py", line 1, in <module>

+    from _struct import *

+ ImportError: No module named _struct

+ This patch adds the build Modules directory to build path.

+ ---

+  Lib/site.py | 4 ++++

+  1 file changed, 4 insertions(+)

+ 

+ diff --git a/Lib/site.py b/Lib/site.py

+ index 9fd76c8157a..868b7cb58fe 100644

+ --- a/Lib/site.py

+ +++ b/Lib/site.py

+ @@ -520,6 +520,10 @@ def main():

   

       abs__file__()

       known_paths = removeduppaths()

@@ -1,7 +1,22 @@ 

- diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io Python-2.7.2/Lib/test/test_io.py

- --- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io	2011-09-01 14:18:45.963304089 -0400

- +++ Python-2.7.2/Lib/test/test_io.py	2011-09-01 15:08:53.796098413 -0400

- @@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:22:43 +0200

+ Subject: [PATCH] 00131-disable-tests-in-test_io.patch

+ 

+ 00131 #

+ The four tests in test_io built on top of check_interrupted_write_retry

+ fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM

+ handlers are never called, and the call to write runs to completion

+ (rhbz#732998)

+ ---

+  Lib/test/test_io.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py

+ index 5ec0b7bb119..d5bf31525fd 100644

+ --- a/Lib/test/test_io.py

+ +++ b/Lib/test/test_io.py

+ @@ -3289,6 +3289,7 @@ class SignalsTest(unittest.TestCase):

           self.check_interrupted_read_retry(lambda x: x,

                                             mode="r")

   

@@ -1,6 +1,43 @@ 

- diff -up Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python-2.7.2/Lib/unittest/case.py

- --- Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest	2011-09-08 14:45:47.677169191 -0400

- +++ Python-2.7.2/Lib/unittest/case.py	2011-09-08 16:01:36.287858159 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:22:59 +0200

+ Subject: [PATCH] 00132-add-rpmbuild-hooks-to-unittest.patch

+ 

+ 00132 #

+ Add non-standard hooks to unittest for use in the "check" phase below, when

+ running selftests within the build:

+   @unittest._skipInRpmBuild(reason)

+ for tests that hang or fail intermittently within the build environment, and:

+   @unittest._expectedFailureInRpmBuild

+ for tests that always fail within the build environment

+ 

+ The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the

+ environment, which we set manually in the appropriate portion of the "check"

+ phase below (and which potentially other python-* rpms could set, to reuse

+ these unittest hooks in their own "check" phases)

+ ---

+  Lib/unittest/__init__.py |  3 ++-

+  Lib/unittest/case.py     | 38 ++++++++++++++++++++++++++++++++++++++

+  2 files changed, 40 insertions(+), 1 deletion(-)

+ 

+ diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py

+ index a5d50af78f2..f1068a5c549 100644

+ --- a/Lib/unittest/__init__.py

+ +++ b/Lib/unittest/__init__.py

+ @@ -57,7 +57,8 @@ __unittest = True

+  

+  from .result import TestResult

+  from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,

+ -                   skipUnless, expectedFailure)

+ +                   skipUnless, expectedFailure,

+ +                   _skipInRpmBuild, _expectedFailureInRpmBuild)

+  from .suite import BaseTestSuite, TestSuite

+  from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,

+                       findTestCases)

+ diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py

+ index a3f75af5279..96bd5a756e8 100644

+ --- a/Lib/unittest/case.py

+ +++ b/Lib/unittest/case.py

  @@ -1,6 +1,7 @@

   """Test case implementation"""

   
@@ -9,7 +46,7 @@ 

   import sys

   import functools

   import difflib

- @@ -94,6 +95,43 @@ def expectedFailure(func):

+ @@ -95,6 +96,43 @@ def expectedFailure(func):

       return wrapper

   

   
@@ -53,16 +90,3 @@ 

   class _AssertRaisesContext(object):

       """A context manager used to implement TestCase.assertRaises* methods."""

   

- diff -up Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-2.7.2/Lib/unittest/__init__.py

- --- Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest	2011-09-08 14:59:39.534112310 -0400

- +++ Python-2.7.2/Lib/unittest/__init__.py	2011-09-08 15:07:09.191081562 -0400

- @@ -57,7 +57,8 @@ __unittest = True

-  

-  from .result import TestResult

-  from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,

- -                   skipUnless, expectedFailure)

- +                   skipUnless, expectedFailure,

- +                   _skipInRpmBuild, _expectedFailureInRpmBuild)

-  from .suite import BaseTestSuite, TestSuite

-  from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,

-                       findTestCases)

file modified
+16 -4
@@ -1,7 +1,19 @@ 

- diff -up Python-2.7.2/Lib/test/test_dl.py.skip-test_dl Python-2.7.2/Lib/test/test_dl.py

- --- Python-2.7.2/Lib/test/test_dl.py.skip-test_dl	2011-09-08 15:18:40.529034289 -0400

- +++ Python-2.7.2/Lib/test/test_dl.py	2011-09-08 16:29:45.184742670 -0400

- @@ -13,6 +13,9 @@ sharedlibs = [

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:23:19 +0200

+ Subject: [PATCH] 00133-skip-test_dl.patch

+ 

+ 00133 #

+ "dl" is deprecated, and test_dl doesn't work on 64-bit builds:

+ ---

+  Lib/test/test_dl.py | 3 +++

+  1 file changed, 3 insertions(+)

+ 

+ diff --git a/Lib/test/test_dl.py b/Lib/test/test_dl.py

+ index da9730f3d61..45d454711c9 100644

+ --- a/Lib/test/test_dl.py

+ +++ b/Lib/test/test_dl.py

+ @@ -12,6 +12,9 @@ sharedlibs = [

       ('/usr/lib/libc.dylib', 'getpid'),

       ]

   

@@ -1,7 +1,20 @@ 

- diff -up Python-2.7.6/Lib/test/test_file2k.py.stdin-test Python-2.7.6/Lib/test/test_file2k.py

- --- Python-2.7.6/Lib/test/test_file2k.py.stdin-test	2013-11-10 08:36:40.000000000 +0100

- +++ Python-2.7.6/Lib/test/test_file2k.py	2014-01-29 14:28:01.029488055 +0100

- @@ -223,6 +223,7 @@ class OtherFileTests(unittest.TestCase):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:23:35 +0200

+ Subject: [PATCH] 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch

+ 

+ 00136 #

+ Some tests try to seek on sys.stdin, but don't work as expected when run

+ within Koji/mock; skip them within the rpm build:

+ ---

+  Lib/test/test_file2k.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py

+ index c73e8d8dc45..662b4c166ae 100644

+ --- a/Lib/test/test_file2k.py

+ +++ b/Lib/test/test_file2k.py

+ @@ -231,6 +231,7 @@ class OtherFileTests(unittest.TestCase):

               else:

                   f.close()

   

@@ -1,7 +1,19 @@ 

- diff -up Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py

- --- Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild	2012-04-09 19:07:29.000000000 -0400

- +++ Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py	2012-04-13 00:20:08.223819263 -0400

- @@ -24,6 +24,7 @@ setup(name='foo', version='0.1', py_modu

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:23:56 +0200

+ Subject: [PATCH] 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch

+ 

+ 00137 #

+ Some tests within distutils fail when run in an rpmbuild:

+ ---

+  Lib/distutils/tests/test_bdist_rpm.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py

+ index 8248c08b19b..78ed410c79d 100644

+ --- a/Lib/distutils/tests/test_bdist_rpm.py

+ +++ b/Lib/distutils/tests/test_bdist_rpm.py

+ @@ -29,6 +29,7 @@ setup(name='foo', version='0.1', py_modules=['foo'],

   

   """

   
@@ -9,4 +21,3 @@ 

   class BuildRpmTestCase(support.TempdirManager,

                          support.EnvironGuard,

                          support.LoggingSilencer,

- diff -up Python-2.7.3/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild Python-2.7.3/Lib/distutils/tests/test_build_ext.py

@@ -1,7 +1,19 @@ 

- diff -up Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild Python-2.7.2/Lib/distutils/tests/test_build_ext.py

- --- Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild	2011-09-08 16:07:25.033834312 -0400

- +++ Python-2.7.2/Lib/distutils/tests/test_build_ext.py	2011-09-08 17:43:15.656441082 -0400

- @@ -330,6 +332,7 @@ class BuildExtTestCase(support.TempdirMa

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:24:12 +0200

+ Subject: [PATCH] 00138-fix-distutils-tests-in-debug-build.patch

+ 

+ 00138 #

+ Fixup some tests within distutils to work with how debug builds are set up:

+ ---

+  Lib/distutils/tests/test_build_ext.py | 15 +++++++++------

+  1 file changed, 9 insertions(+), 6 deletions(-)

+ 

+ diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py

+ index a6d2d2eb155..688bdd1bb62 100644

+ --- a/Lib/distutils/tests/test_build_ext.py

+ +++ b/Lib/distutils/tests/test_build_ext.py

+ @@ -332,6 +332,7 @@ class BuildExtTestCase(support.TempdirManager,

           self.assertEqual(lastdir, 'bar')

   

       def test_ext_fullpath(self):
@@ -9,7 +21,7 @@ 

           ext = sysconfig.get_config_vars()['SO']

           dist = Distribution()

           cmd = build_ext(dist)

- @@ -337,14 +340,14 @@ class BuildExtTestCase(support.TempdirMa

+ @@ -339,14 +340,14 @@ class BuildExtTestCase(support.TempdirManager,

           cmd.distribution.package_dir = {'': 'src'}

           cmd.distribution.packages = ['lxml', 'lxml.html']

           curdir = os.getcwd()
@@ -26,7 +38,7 @@ 

           path = cmd.get_ext_fullpath('lxml.etree')

           self.assertEqual(wanted, path)

   

- @@ -354,13 +357,13 @@ class BuildExtTestCase(support.TempdirMa

+ @@ -356,13 +357,13 @@ class BuildExtTestCase(support.TempdirManager,

           cmd.distribution.packages = ['twisted', 'twisted.runner.portmap']

           path = cmd.get_ext_fullpath('twisted.runner.portmap')

           wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
@@ -42,7 +54,7 @@ 

           self.assertEqual(wanted, path)

   

       def test_build_ext_inplace(self):

- @@ -373,8 +376,9 @@ class BuildExtTestCase(support.TempdirMa

+ @@ -375,8 +376,9 @@ class BuildExtTestCase(support.TempdirManager,

           cmd.distribution.package_dir = {'': 'src'}

           cmd.distribution.packages = ['lxml', 'lxml.html']

           curdir = os.getcwd()
@@ -53,7 +65,7 @@ 

           path = cmd.get_ext_fullpath('lxml.etree')

           self.assertEqual(wanted, path)

   

- @@ -412,10 +416,11 @@ class BuildExtTestCase(support.TempdirMa

+ @@ -414,10 +416,11 @@ class BuildExtTestCase(support.TempdirManager,

           dist = Distribution({'name': 'UpdateManager'})

           cmd = build_ext(dist)

           cmd.ensure_finalized()

@@ -1,7 +1,20 @@ 

- diff -up Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm Python-2.7.2/Lib/test/test_float.py

- --- Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm	2011-09-08 19:34:09.000986128 -0400

- +++ Python-2.7.2/Lib/test/test_float.py	2011-09-08 19:34:57.969982779 -0400

- @@ -1072,6 +1072,7 @@ class HexFloatTestCase(unittest.TestCase

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:24:27 +0200

+ Subject: [PATCH] 00139-skip-test_float-known-failure-on-arm.patch

+ 

+ 00139 #

+ ARM-specific: skip known failure in test_float:

+  http://bugs.python.org/issue8265 (rhbz#706253)

+ ---

+  Lib/test/test_float.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py

+ index c917c1ea458..a2b8f69ffb6 100644

+ --- a/Lib/test/test_float.py

+ +++ b/Lib/test/test_float.py

+ @@ -1132,6 +1132,7 @@ class HexFloatTestCase(unittest.TestCase):

                       self.identical(got, expected)

   

   

@@ -1,7 +1,21 @@ 

- diff -up Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc Python-2.7.2/Lib/ctypes/test/test_callbacks.py

- --- Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc	2011-09-08 19:42:35.541951490 -0400

- +++ Python-2.7.2/Lib/ctypes/test/test_callbacks.py	2011-09-08 19:43:40.676947036 -0400

- @@ -67,6 +67,7 @@ class Callbacks(unittest.TestCase):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:24:44 +0200

+ Subject: [PATCH] 00140-skip-test_ctypes-known-failure-on-sparc.patch

+ 

+ 00140 #

+ Sparc-specific: skip known failure in test_ctypes:

+  http://bugs.python.org/issue8314 (rhbz#711584)

+ which appears to be a libffi bug

+ ---

+  Lib/ctypes/test/test_callbacks.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py

+ index db3d9e7b198..c5a997b308e 100644

+ --- a/Lib/ctypes/test/test_callbacks.py

+ +++ b/Lib/ctypes/test/test_callbacks.py

+ @@ -69,6 +69,7 @@ class Callbacks(unittest.TestCase):

           self.check_type(c_longlong, 42)

           self.check_type(c_longlong, -42)

   

@@ -1,6 +1,19 @@ 

- diff -up Python-2.7.6/Lib/test/test_openpty.py.tty-fail Python-2.7.6/Lib/test/test_openpty.py

- --- Python-2.7.6/Lib/test/test_openpty.py.tty-fail	2014-01-29 14:31:43.761343267 +0100

- +++ Python-2.7.6/Lib/test/test_openpty.py	2014-01-29 14:32:19.284090165 +0100

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:25:00 +0200

+ Subject: [PATCH] 00142-skip-failing-pty-tests-in-rpmbuild.patch

+ 

+ 00142 #

+ Some pty tests fail when run in mock (rhbz#714627):

+ ---

+  Lib/test/test_openpty.py | 1 +

+  Lib/test/test_pty.py     | 1 +

+  2 files changed, 2 insertions(+)

+ 

+ diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py

+ index 4b34b3a3c77..a1a5832a7ad 100644

+ --- a/Lib/test/test_openpty.py

+ +++ b/Lib/test/test_openpty.py

  @@ -8,6 +8,7 @@ if not hasattr(os, "openpty"):

   

   
@@ -9,10 +22,11 @@ 

       def test(self):

           master, slave = os.openpty()

           self.addCleanup(os.close, master)

- diff -up Python-2.7.6/Lib/test/test_pty.py.tty-fail Python-2.7.6/Lib/test/test_pty.py

- --- Python-2.7.6/Lib/test/test_pty.py.tty-fail	2013-11-10 08:36:40.000000000 +0100

- +++ Python-2.7.6/Lib/test/test_pty.py	2014-01-29 14:31:43.761343267 +0100

- @@ -111,6 +111,7 @@ class PtyTest(unittest.TestCase):

+ diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py

+ index 0eb31fdaf70..9f12a51a50e 100644

+ --- a/Lib/test/test_pty.py

+ +++ b/Lib/test/test_pty.py

+ @@ -125,6 +125,7 @@ class PtyTest(unittest.TestCase):

           os.close(master_fd)

   

   

file modified
+22 -9
@@ -1,6 +1,20 @@ 

- diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c

- --- Python-2.7.2/Python/ceval.c.tsc-on-ppc	2011-08-23 14:59:48.051300849 -0400

- +++ Python-2.7.2/Python/ceval.c	2011-08-23 15:33:25.412162902 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:25:15 +0200

+ Subject: [PATCH] 00143-tsc-on-ppc.patch

+ 

+ 00143 #

+ Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid

+ aliasing violations (rhbz#698726)

+ Sent upstream as http://bugs.python.org/issue12872

+ ---

+  Python/ceval.c | 40 +++++++++++++++++++++++++++++-----------

+  1 file changed, 29 insertions(+), 11 deletions(-)

+ 

+ diff --git a/Python/ceval.c b/Python/ceval.c

+ index b7427f9658c..80493335ebf 100644

+ --- a/Python/ceval.c

+ +++ b/Python/ceval.c

  @@ -37,24 +37,42 @@ typedef unsigned long long uint64;

   */

   #if defined(__ppc__) || defined (__powerpc__)
@@ -40,16 +54,15 @@ 

  -    asm volatile ("mftb  %0" : "=r" (tb)  );

  -    asm volatile ("mftbu %0" : "=r" (tbu2));

  -    if (__builtin_expect(tbu != tbu2, 0)) goto loop;

- -

- -    /* The slightly peculiar way of writing the next lines is

- -       compiled better by GCC than any other way I tried. */

- -    ((long*)(v))[0] = tbu;

- -    ((long*)(v))[1] = tb;

  +    asm volatile ("mftbu %0" : "=r" (u.ii[0]) );

  +    asm volatile ("mftb  %0" : "=r" (u.ii[1]) );

  +    asm volatile ("mftbu %0" : "=r" (tmp));

  +    if (__builtin_expect(u.ii[0] != tmp, 0)) goto loop;

- +

+  

+ -    /* The slightly peculiar way of writing the next lines is

+ -       compiled better by GCC than any other way I tried. */

+ -    ((long*)(v))[0] = tbu;

+ -    ((long*)(v))[1] = tb;

  +    *v = u.ll;

   }

  +#endif /* powerpc 32/64 bit */

file modified
+16 -4
@@ -1,7 +1,19 @@ 

- diff -up Python-2.7.2/Modules/Setup.dist.no-gdbm Python-2.7.2/Modules/Setup.dist

- --- Python-2.7.2/Modules/Setup.dist.no-gdbm	2011-09-13 14:25:43.496095926 -0400

- +++ Python-2.7.2/Modules/Setup.dist	2011-09-13 14:25:46.491095724 -0400

- @@ -396,7 +396,7 @@ dl dlmodule.c

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:25:28 +0200

+ Subject: [PATCH] 00144-no-gdbm.patch

+ 

+ 00144 #

+ (Optionally) disable the gdbm module:

+ ---

+  Modules/Setup.dist | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/Modules/Setup.dist b/Modules/Setup.dist

+ index c4c88cbf964..2513d71c3bf 100644

+ --- a/Modules/Setup.dist

+ +++ b/Modules/Setup.dist

+ @@ -400,7 +400,7 @@ dl dlmodule.c

   #

   # First, look at Setup.config; configure may have set this for you.

   

file modified
+109 -74
@@ -1,6 +1,36 @@ 

- diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips Python-2.7.2/Lib/hashlib.py

- --- Python-2.7.2/Lib/hashlib.py.hashlib-fips	2011-06-11 11:46:24.000000000 -0400

- +++ Python-2.7.2/Lib/hashlib.py	2011-09-14 00:21:26.194252001 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:36:24 +0200

+ Subject: [PATCH] 00146-hashlib-fips.patch

+ 

+ 00146 #

+ Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)

+ - handle failures from OpenSSL (e.g. on attempts to use MD5 in a

+   FIPS-enforcing environment)

+ - add a new "usedforsecurity" keyword argument to the various digest

+   algorithms in hashlib so that you can whitelist a callsite with

+   "usedforsecurity=False"

+ (sent upstream for python 3 as http://bugs.python.org/issue9216; this is a

+ backport to python 2.7; see RHEL6 patch 119)

+ - enforce usage of the _hashlib implementation: don't fall back to the _md5

+   and _sha* modules (leading to clearer error messages if fips selftests

+   fail)

+ - don't build the _md5 and _sha* modules; rely on the _hashlib implementation

+   of hashlib (for example, md5.py will use _hashlib's implementation of MD5,

+   if permitted by the FIPS setting)

+ (rhbz#563986)

+ ---

+  Lib/hashlib.py           |  86 ++++++---------

+  Lib/test/test_hashlib.py | 132 +++++++++++++++--------

+  Modules/Setup.dist       |   8 +-

+  Modules/_hashopenssl.c   | 227 ++++++++++++++++++++++++++++++---------

+  setup.py                 |  15 ---

+  5 files changed, 304 insertions(+), 164 deletions(-)

+ 

+ diff --git a/Lib/hashlib.py b/Lib/hashlib.py

+ index bbd06b9996e..72361bbe817 100644

+ --- a/Lib/hashlib.py

+ +++ b/Lib/hashlib.py

  @@ -6,9 +6,12 @@

   

   __doc__ = """hashlib module - A common interface to many hash functions.
@@ -17,7 +47,7 @@ 

   

   Named constructor functions are also available, these are much faster

   than using new():

- @@ -24,6 +27,20 @@ the zlib module.

+ @@ -25,6 +28,20 @@ the zlib module.

   Choose your hash function wisely.  Some have known collision weaknesses.

   sha384 and sha512 will be slow on 32 bit platforms.

   
@@ -38,7 +68,7 @@ 

   Hash objects have these methods:

    - update(arg): Update the hash object with the string arg. Repeated calls

                   are equivalent to a single call with the concatenation of all

- @@ -63,76 +80,41 @@ algorithms = __always_supported

+ @@ -69,66 +86,31 @@ __all__ = __always_supported + ('new', 'algorithms_guaranteed',

                                   'pbkdf2_hmac')

   

   
@@ -116,8 +146,7 @@ 

   

   try:

       import _hashlib

-      new = __hash_new

-      __get_hash = __get_openssl_constructor

+ @@ -137,8 +119,8 @@ try:

       algorithms_available = algorithms_available.union(

           _hashlib.openssl_md_meth_names)

   except ImportError:
@@ -128,16 +157,17 @@ 

   

   for __func_name in __always_supported:

       # try them all, some may not work due to the OpenSSL

- @@ -143,4 +125,4 @@ for __func_name in __always_supported:

+ @@ -218,4 +200,4 @@ except ImportError:

   

   # Cleanup locals()

   del __always_supported, __func_name, __get_hash

  -del __py_new, __hash_new, __get_openssl_constructor

  +del __hash_new, __get_openssl_constructor

- diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips Python-2.7.2/Lib/test/test_hashlib.py

- --- Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips	2011-06-11 11:46:25.000000000 -0400

- +++ Python-2.7.2/Lib/test/test_hashlib.py	2011-09-14 01:08:55.525254195 -0400

- @@ -32,6 +32,19 @@ def hexstr(s):

+ diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py

+ index b8d6388feaf..e0520edb08a 100644

+ --- a/Lib/test/test_hashlib.py

+ +++ b/Lib/test/test_hashlib.py

+ @@ -34,6 +34,19 @@ def hexstr(s):

           r = r + h[(i >> 4) & 0xF] + h[i & 0xF]

       return r

   
@@ -157,7 +187,7 @@ 

   

   class HashLibTestCase(unittest.TestCase):

       supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1',

- @@ -61,10 +74,10 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -63,10 +76,10 @@ class HashLibTestCase(unittest.TestCase):

           # of hashlib.new given the algorithm name.

           for algorithm, constructors in self.constructors_to_test.items():

               constructors.add(getattr(hashlib, algorithm))
@@ -171,7 +201,7 @@ 

               constructors.add(_test_algorithm_via_hashlib_new)

   

           _hashlib = self._conditional_import_module('_hashlib')

- @@ -78,28 +91,13 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -80,28 +93,13 @@ class HashLibTestCase(unittest.TestCase):

                   if constructor:

                       constructors.add(constructor)

   
@@ -201,7 +231,7 @@ 

               c.hexdigest()

   

       def test_algorithms_attribute(self):

- @@ -115,28 +113,9 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -122,28 +120,9 @@ class HashLibTestCase(unittest.TestCase):

           self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')

           self.assertRaises(TypeError, hashlib.new, 1)

   
@@ -231,7 +261,7 @@ 

               self.assertTrue(hexstr(h.digest()) == h.hexdigest())

   

       def test_large_update(self):

- @@ -145,16 +125,16 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -153,16 +132,16 @@ class HashLibTestCase(unittest.TestCase):

           abcs = aas + bees + cees

   

           for name in self.supported_hash_names:
@@ -251,7 +281,7 @@ 

               self.assertEqual(m1.digest(), m3.digest(), name+' new problem.')

   

       def check(self, name, data, digest):

- @@ -162,7 +142,7 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -170,7 +149,7 @@ class HashLibTestCase(unittest.TestCase):

           # 2 is for hashlib.name(...) and hashlib.new(name, ...)

           self.assertGreaterEqual(len(constructors), 2)

           for hash_object_constructor in constructors:
@@ -260,7 +290,7 @@ 

               self.assertEqual(

                       computed, digest,

                       "Hash algorithm %s constructed using %s returned hexdigest"

- @@ -172,7 +152,8 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -195,7 +174,8 @@ class HashLibTestCase(unittest.TestCase):

   

       def check_unicode(self, algorithm_name):

           # Unicode objects are not allowed as input.
@@ -270,7 +300,7 @@ 

           self.check(algorithm_name, u'spam', expected)

   

       def test_unicode(self):

- @@ -354,6 +335,70 @@ class HashLibTestCase(unittest.TestCase)

+ @@ -394,6 +374,70 @@ class HashLibTestCase(unittest.TestCase):

           self.assertEqual(expected_hash, hasher.hexdigest())

   

   
@@ -341,10 +371,11 @@ 

   class KDFTests(unittest.TestCase):

       pbkdf2_test_vectors = [

           (b'password', b'salt', 1, None),

- diff -up Python-2.7.2/Modules/Setup.dist.hashlib-fips Python-2.7.2/Modules/Setup.dist

- --- Python-2.7.2/Modules/Setup.dist.hashlib-fips	2011-09-14 00:21:26.163252001 -0400

- +++ Python-2.7.2/Modules/Setup.dist	2011-09-14 00:21:26.201252001 -0400

- @@ -248,14 +248,14 @@ imageop imageop.c	# Operations on images

+ diff --git a/Modules/Setup.dist b/Modules/Setup.dist

+ index 2513d71c3bf..9a8d630e8ba 100644

+ --- a/Modules/Setup.dist

+ +++ b/Modules/Setup.dist

+ @@ -252,14 +252,14 @@ imageop imageop.c	# Operations on images

   # Message-Digest Algorithm, described in RFC 1321.  The necessary files

   # md5.c and md5.h are included here.

   
@@ -363,43 +394,19 @@ 

   

   

   # SGI IRIX specific modules -- off by default.

- diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py

- --- Python-2.7.2/setup.py.hashlib-fips	2011-09-14 00:21:25.722252001 -0400

- +++ Python-2.7.2/setup.py	2011-09-14 00:21:26.203252001 -0400

- @@ -768,21 +768,6 @@ class PyBuildExt(build_ext):

-                  print ("warning: openssl 0x%08x is too old for _hashlib" %

-                         openssl_ver)

-                  missing.append('_hashlib')

- -        if COMPILED_WITH_PYDEBUG or not have_usable_openssl:

- -            # The _sha module implements the SHA1 hash algorithm.

- -            exts.append( Extension('_sha', ['shamodule.c']) )

- -            # The _md5 module implements the RSA Data Security, Inc. MD5

- -            # Message-Digest Algorithm, described in RFC 1321.  The

- -            # necessary files md5.c and md5.h are included here.

- -            exts.append( Extension('_md5',

- -                            sources = ['md5module.c', 'md5.c'],

- -                            depends = ['md5.h']) )

- -

- -        min_sha2_openssl_ver = 0x00908000

- -        if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:

- -            # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash

- -            exts.append( Extension('_sha256', ['sha256module.c']) )

- -            exts.append( Extension('_sha512', ['sha512module.c']) )

+ diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c

+ index 5df08e54b24..b80b4ec8cd6 100644

+ --- a/Modules/_hashopenssl.c

+ +++ b/Modules/_hashopenssl.c

+ @@ -41,6 +41,7 @@

+  /* We use the object interface to discover what hashes OpenSSL supports. */

+  #include <openssl/objects.h>

+  #include "openssl/err.h"

+ +#include <openssl/ssl.h>

   

-          # Modules that provide persistent dictionary-like semantics.  You will

-          # probably want to arrange for at least one of them to be available on

- --- Python-2.7.8/Modules/_hashopenssl.c.orig	2014-06-30 04:05:41.000000000 +0200

- +++ Python-2.7.8/Modules/_hashopenssl.c	2014-07-14 14:21:59.546386572 +0200

- @@ -36,6 +36,8 @@

-  #endif

+  #define MUNCH_SIZE INT_MAX

   

-  /* EVP is the preferred interface to hashing in OpenSSL */

- +#include <openssl/ssl.h>

- +#include <openssl/err.h>

-  #include <openssl/evp.h>

-  #include <openssl/hmac.h>

-  #include <openssl/err.h>

- @@ -67,11 +69,19 @@

+ @@ -80,10 +81,19 @@ typedef struct {

   

   static PyTypeObject EVPtype;

   
@@ -416,14 +423,13 @@ 

   

  -#define DEFINE_CONSTS_FOR_NEW(Name)  \

  -    static PyObject *CONST_ ## Name ## _name_obj = NULL; \

- -    static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \

  -    static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;

  +#define DEFINE_CONSTS_FOR_NEW(Name) \

  +    static EVPCachedInfo cached_info_ ##Name;

   

   DEFINE_CONSTS_FOR_NEW(md5)

   DEFINE_CONSTS_FOR_NEW(sha1)

- @@ -117,6 +127,48 @@

+ @@ -167,6 +177,48 @@ EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len)

       }

   }

   
@@ -472,7 +478,7 @@ 

   /* Internal methods for a hash object */

   

   static void

- @@ -315,14 +367,15 @@

+ @@ -388,14 +440,15 @@ EVP_repr(PyObject *self)

   static int

   EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)

   {
@@ -491,11 +497,11 @@ 

           return -1;

       }

   

- @@ -338,7 +391,12 @@

+ @@ -411,7 +464,12 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)

           PyBuffer_Release(&view);

           return -1;

       }

- -    EVP_DigestInit(&self->ctx, digest);

+ -    EVP_DigestInit(self->ctx, digest);

  +    mc_ctx_init(&self->ctx, usedforsecurity);

  +    if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {

  +        set_evp_exception();
@@ -505,7 +511,7 @@ 

   

       self->name = name_obj;

       Py_INCREF(self->name);

- @@ -422,7 +480,8 @@

+ @@ -495,7 +553,8 @@ static PyTypeObject EVPtype = {

   static PyObject *

   EVPnew(PyObject *name_obj,

          const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
@@ -515,11 +521,11 @@ 

   {

       EVPobject *self;

   

- @@ -437,7 +496,12 @@

+ @@ -510,7 +569,12 @@ EVPnew(PyObject *name_obj,

       if (initial_ctx) {

-          EVP_MD_CTX_copy(&self->ctx, initial_ctx);

+          EVP_MD_CTX_copy(self->ctx, initial_ctx);

       } else {

- -        EVP_DigestInit(&self->ctx, digest);

+ -        EVP_DigestInit(self->ctx, digest);

  +        mc_ctx_init(&self->ctx, usedforsecurity);

  +        if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {

  +            set_evp_exception();
@@ -529,7 +535,7 @@ 

       }

   

       if (cp && len) {

- @@ -461,20 +525,28 @@

+ @@ -534,20 +598,28 @@ PyDoc_STRVAR(EVP_new__doc__,

   An optional string argument may be provided and will be\n\

   automatically hashed.\n\

   \n\
@@ -562,7 +568,7 @@ 

           return NULL;

       }

   

- @@ -487,7 +559,7 @@

+ @@ -560,7 +632,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)

       digest = EVP_get_digestbyname(name);

   

       ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@@ -571,13 +577,13 @@ 

       PyBuffer_Release(&view);

   

       return ret_obj;

- @@ -713,51 +785,111 @@

+ @@ -820,51 +892,111 @@ generate_hash_name_list(void)

   

   

   /*

  - *  This macro generates constructor function definitions for specific

  - *  hash algorithms.  These constructors are much faster than calling

- - *  the generic one passing it a python string and are noticably

+ - *  the generic one passing it a python string and are noticeably

  - *  faster than calling a python new() wrapper.  Thats important for

  + *  This macro and function generates a family of constructor function

  + *  definitions for specific hash algorithms.  These constructors are much
@@ -671,7 +677,7 @@ 

  -    if (CONST_ ## NAME ## _name_obj == NULL) { \

  -    CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \

  -        if (EVP_get_digestbyname(#NAME)) { \

- -            CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \

+ -            CONST_new_ ## NAME ## _ctx_p = EVP_MD_CTX_new(); \

  -            EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \

  -        } \

  -    } \
@@ -713,14 +719,17 @@ 

   GEN_CONSTRUCTOR(md5)

   GEN_CONSTRUCTOR(sha1)

   #ifdef _OPENSSL_SUPPORTS_SHA2

- @@ -794,14 +926,11 @@

+ @@ -901,17 +1033,14 @@ init_hashlib(void)

   {

       PyObject *m, *openssl_md_meth_names;

   

  +    SSL_load_error_strings();

  +    SSL_library_init();

-      OpenSSL_add_all_digests();

+  #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)

+      /* Load all digest algorithms and initialize cpuid */

+      OPENSSL_add_all_algorithms_noconf();

       ERR_load_crypto_strings();

+  #endif

   

  -    /* TODO build EVP_functions openssl_* entries dynamically based

  -     * on what hashes are supported rather than listing many
@@ -730,3 +739,29 @@ 

       Py_TYPE(&EVPtype) = &PyType_Type;

       if (PyType_Ready(&EVPtype) < 0)

           return;

+ diff --git a/setup.py b/setup.py

+ index ca48b11c278..741dd3b5222 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -920,21 +920,6 @@ class PyBuildExt(build_ext):

+                  print ("warning: openssl 0x%08x is too old for _hashlib" %

+                         openssl_ver)

+                  missing.append('_hashlib')

+ -        if COMPILED_WITH_PYDEBUG or not have_usable_openssl:

+ -            # The _sha module implements the SHA1 hash algorithm.

+ -            exts.append( Extension('_sha', ['shamodule.c']) )

+ -            # The _md5 module implements the RSA Data Security, Inc. MD5

+ -            # Message-Digest Algorithm, described in RFC 1321.  The

+ -            # necessary files md5.c and md5.h are included here.

+ -            exts.append( Extension('_md5',

+ -                            sources = ['md5module.c', 'md5.c'],

+ -                            depends = ['md5.h']) )

+ -

+ -        min_sha2_openssl_ver = 0x00908000

+ -        if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:

+ -            # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash

+ -            exts.append( Extension('_sha256', ['sha256module.c']) )

+ -            exts.append( Extension('_sha512', ['sha512module.c']) )

+  

+          # Modules that provide persistent dictionary-like semantics.  You will

+          # probably want to arrange for at least one of them to be available on

file modified
+170 -106
@@ -1,7 +1,46 @@ 

- diff -up Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats Python-2.7.2/Include/dictobject.h

- --- Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/dictobject.h	2011-09-16 19:03:25.105821625 -0400

- @@ -150,6 +150,8 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemStr

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:37:52 +0200

+ Subject: [PATCH] 00147-add-debug-malloc-stats.patch

+ 

+ 00147 #

+ Add a sys._debugmallocstats() function

+ Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198

+ Sent upstream as http://bugs.python.org/issue14785

+ ---

+  Include/dictobject.h    |  2 ++

+  Include/floatobject.h   |  1 +

+  Include/frameobject.h   |  2 ++

+  Include/intobject.h     |  2 ++

+  Include/listobject.h    |  2 ++

+  Include/methodobject.h  |  4 +++

+  Include/object.h        |  7 ++++

+  Include/objimpl.h       |  2 +-

+  Include/stringobject.h  |  2 ++

+  Include/unicodeobject.h |  2 ++

+  Lib/test/test_sys.py    | 26 ++++++++++++++

+  Objects/classobject.c   |  9 +++++

+  Objects/dictobject.c    |  9 +++++

+  Objects/floatobject.c   | 16 +++++++++

+  Objects/frameobject.c   | 10 ++++++

+  Objects/intobject.c     | 17 +++++++++

+  Objects/listobject.c    |  9 +++++

+  Objects/methodobject.c  |  9 +++++

+  Objects/object.c        | 17 +++++++++

+  Objects/obmalloc.c      | 80 +++++++++++++++++++++++------------------

+  Objects/setobject.c     | 10 ++++++

+  Objects/stringobject.c  | 40 +++++++++++++++++++++

+  Objects/tupleobject.c   | 16 +++++++++

+  Objects/unicodeobject.c |  6 ++++

+  Python/pythonrun.c      |  2 +-

+  Python/sysmodule.c      | 53 +++++++++++++++++++++++++++

+  26 files changed, 319 insertions(+), 36 deletions(-)

+ 

+ diff --git a/Include/dictobject.h b/Include/dictobject.h

+ index 5a1e9feea13..da89cec6362 100644

+ --- a/Include/dictobject.h

+ +++ b/Include/dictobject.h

+ @@ -154,6 +154,8 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);

   PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);

   PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);

   
@@ -10,10 +49,11 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats Python-2.7.2/Include/floatobject.h

- --- Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/floatobject.h	2011-09-16 19:03:25.106821625 -0400

- @@ -132,6 +132,7 @@ PyAPI_FUNC(PyObject *) _PyFloat_FormatAd

+ diff --git a/Include/floatobject.h b/Include/floatobject.h

+ index 54e88256a2e..33c6ac0d78f 100644

+ --- a/Include/floatobject.h

+ +++ b/Include/floatobject.h

+ @@ -132,6 +132,7 @@ PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,

      failure.  Used in builtin_round in bltinmodule.c. */

   PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);

   
@@ -21,10 +61,11 @@ 

   

   

   #ifdef __cplusplus

- diff -up Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats Python-2.7.2/Include/frameobject.h

- --- Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/frameobject.h	2011-09-16 19:03:25.107821625 -0400

- @@ -80,6 +80,8 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(Py

+ diff --git a/Include/frameobject.h b/Include/frameobject.h

+ index 34603794c65..db89a4af05b 100644

+ --- a/Include/frameobject.h

+ +++ b/Include/frameobject.h

+ @@ -80,6 +80,8 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);

   

   PyAPI_FUNC(int) PyFrame_ClearFreeList(void);

   
@@ -33,10 +74,11 @@ 

   /* Return the line of code the frame is currently executing. */

   PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);

   

- diff -up Python-2.7.2/Include/intobject.h.add-debug-malloc-stats Python-2.7.2/Include/intobject.h

- --- Python-2.7.2/Include/intobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/intobject.h	2011-09-16 19:03:25.107821625 -0400

- @@ -74,6 +74,8 @@ PyAPI_FUNC(PyObject *) _PyInt_FormatAdva

+ diff --git a/Include/intobject.h b/Include/intobject.h

+ index d1985748b3e..60cb9e0c44b 100644

+ --- a/Include/intobject.h

+ +++ b/Include/intobject.h

+ @@ -78,6 +78,8 @@ PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj,

   					     char *format_spec,

   					     Py_ssize_t format_spec_len);

   
@@ -45,10 +87,11 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/listobject.h.add-debug-malloc-stats Python-2.7.2/Include/listobject.h

- --- Python-2.7.2/Include/listobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/listobject.h	2011-09-16 19:03:25.107821625 -0400

- @@ -62,6 +62,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(Py

+ diff --git a/Include/listobject.h b/Include/listobject.h

+ index f19b1c5e56c..7fccb477e1e 100644

+ --- a/Include/listobject.h

+ +++ b/Include/listobject.h

+ @@ -62,6 +62,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);

   #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))

   #define PyList_GET_SIZE(op)    Py_SIZE(op)

   
@@ -57,9 +100,10 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats Python-2.7.2/Include/methodobject.h

- --- Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/methodobject.h	2011-09-16 19:03:25.108821625 -0400

+ diff --git a/Include/methodobject.h b/Include/methodobject.h

+ index 6e160b63900..1944517b392 100644

+ --- a/Include/methodobject.h

+ +++ b/Include/methodobject.h

  @@ -87,6 +87,10 @@ typedef struct {

   

   PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
@@ -71,10 +115,11 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats Python-2.7.2/Include/object.h

- --- Python-2.7.2/Include/object.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/object.h	2011-09-16 19:03:25.108821625 -0400

- @@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l

+ diff --git a/Include/object.h b/Include/object.h

+ index 807b24188a7..a9d207929e0 100644

+ --- a/Include/object.h

+ +++ b/Include/object.h

+ @@ -1040,6 +1040,13 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void);

               _PyTrash_thread_deposit_object((PyObject*)op); \

       } while (0);

   
@@ -88,9 +133,10 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats Python-2.7.2/Include/objimpl.h

- --- Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/objimpl.h	2011-09-16 19:03:25.108821625 -0400

+ diff --git a/Include/objimpl.h b/Include/objimpl.h

+ index cbf6bc3f876..8c14ab801a1 100644

+ --- a/Include/objimpl.h

+ +++ b/Include/objimpl.h

  @@ -101,13 +101,13 @@ PyAPI_FUNC(void) PyObject_Free(void *);

   

   /* Macros */
@@ -106,10 +152,11 @@ 

   PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes);

   PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes);

   PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p);

- diff -up Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats Python-2.7.2/Include/stringobject.h

- --- Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/stringobject.h	2011-09-16 19:03:25.109821625 -0400

- @@ -204,6 +204,8 @@ PyAPI_FUNC(PyObject *) _PyBytes_FormatAd

+ diff --git a/Include/stringobject.h b/Include/stringobject.h

+ index 12cc093c629..0a5fbd1c2e7 100644

+ --- a/Include/stringobject.h

+ +++ b/Include/stringobject.h

+ @@ -204,6 +204,8 @@ PyAPI_FUNC(PyObject *) _PyBytes_FormatAdvanced(PyObject *obj,

   					       char *format_spec,

   					       Py_ssize_t format_spec_len);

   
@@ -118,9 +165,10 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats Python-2.7.2/Include/unicodeobject.h

- --- Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats	2011-06-11 11:46:23.000000000 -0400

- +++ Python-2.7.2/Include/unicodeobject.h	2011-09-16 19:03:25.109821625 -0400

+ diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h

+ index 7781f966301..321bd20f2f7 100644

+ --- a/Include/unicodeobject.h

+ +++ b/Include/unicodeobject.h

  @@ -1406,6 +1406,8 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(

       Py_UNICODE ch       /* Unicode character */

       );
@@ -130,10 +178,11 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats Python-2.7.2/Lib/test/test_sys.py

- --- Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats	2011-09-16 19:03:25.048821626 -0400

- +++ Python-2.7.2/Lib/test/test_sys.py	2011-09-16 19:03:25.110821625 -0400

- @@ -473,6 +473,32 @@ class SysModuleTest(unittest.TestCase):

+ diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py

+ index 9342716272a..331c0e9391e 100644

+ --- a/Lib/test/test_sys.py

+ +++ b/Lib/test/test_sys.py

+ @@ -487,6 +487,32 @@ class SysModuleTest(unittest.TestCase):

           p.wait()

           self.assertIn(executable, ["''", repr(sys.executable)])

   
@@ -165,11 +214,12 @@ 

  +

   @test.test_support.cpython_only

   class SizeofTest(unittest.TestCase):

- 

- diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats Python-2.7.2/Objects/classobject.c

- --- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/classobject.c	2011-09-16 19:03:25.110821625 -0400

- @@ -2670,3 +2670,12 @@ PyMethod_Fini(void)

+  

+ diff --git a/Objects/classobject.c b/Objects/classobject.c

+ index 02d7cfd019b..1c44a4729c9 100644

+ --- a/Objects/classobject.c

+ +++ b/Objects/classobject.c

+ @@ -2691,3 +2691,12 @@ PyMethod_Fini(void)

   {

       (void)PyMethod_ClearFreeList();

   }
@@ -182,9 +232,10 @@ 

  +                           "free PyMethodObject",

  +                           numfree, sizeof(PyMethodObject));

  +}

- diff -up Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats Python-2.7.2/Objects/dictobject.c

- --- Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/dictobject.c	2011-09-16 19:03:25.111821625 -0400

+ diff --git a/Objects/dictobject.c b/Objects/dictobject.c

+ index c544ecd8c2d..89ca39c97d4 100644

+ --- a/Objects/dictobject.c

+ +++ b/Objects/dictobject.c

  @@ -225,6 +225,15 @@ show_track(void)

   static PyDictObject *free_list[PyDict_MAXFREELIST];

   static int numfree = 0;
@@ -201,10 +252,11 @@ 

   void

   PyDict_Fini(void)

   {

- diff -up Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats Python-2.7.2/Objects/floatobject.c

- --- Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/floatobject.c	2011-09-16 19:03:25.111821625 -0400

- @@ -35,6 +35,22 @@ typedef struct _floatblock PyFloatBlock;

+ diff --git a/Objects/floatobject.c b/Objects/floatobject.c

+ index 5954d39cdb3..02acc8c0611 100644

+ --- a/Objects/floatobject.c

+ +++ b/Objects/floatobject.c

+ @@ -34,6 +34,22 @@ typedef struct _floatblock PyFloatBlock;

   static PyFloatBlock *block_list = NULL;

   static PyFloatObject *free_list = NULL;

   
@@ -227,10 +279,11 @@ 

   static PyFloatObject *

   fill_free_list(void)

   {

- diff -up Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats Python-2.7.2/Objects/frameobject.c

- --- Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/frameobject.c	2011-09-16 19:03:25.112821625 -0400

- @@ -980,3 +980,13 @@ PyFrame_Fini(void)

+ diff --git a/Objects/frameobject.c b/Objects/frameobject.c

+ index 4c91dd0c084..03a66dc9057 100644

+ --- a/Objects/frameobject.c

+ +++ b/Objects/frameobject.c

+ @@ -1019,3 +1019,13 @@ PyFrame_Fini(void)

       Py_XDECREF(builtin_object);

       builtin_object = NULL;

   }
@@ -244,9 +297,10 @@ 

  +                           numfree, sizeof(PyFrameObject));

  +}

  +

- diff -up Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats Python-2.7.2/Objects/intobject.c

- --- Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/intobject.c	2011-09-16 19:03:25.112821625 -0400

+ diff --git a/Objects/intobject.c b/Objects/intobject.c

+ index 9b27c35d88d..703fa5a5880 100644

+ --- a/Objects/intobject.c

+ +++ b/Objects/intobject.c

  @@ -44,6 +44,23 @@ typedef struct _intblock PyIntBlock;

   static PyIntBlock *block_list = NULL;

   static PyIntObject *free_list = NULL;
@@ -271,9 +325,10 @@ 

   static PyIntObject *

   fill_free_list(void)

   {

- diff -up Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats Python-2.7.2/Objects/listobject.c

- --- Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/listobject.c	2011-09-16 19:03:25.113821625 -0400

+ diff --git a/Objects/listobject.c b/Objects/listobject.c

+ index 24eff769c64..38848bd5cf6 100644

+ --- a/Objects/listobject.c

+ +++ b/Objects/listobject.c

  @@ -109,6 +109,15 @@ PyList_Fini(void)

       }

   }
@@ -290,9 +345,10 @@ 

   PyObject *

   PyList_New(Py_ssize_t size)

   {

- diff -up Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats Python-2.7.2/Objects/methodobject.c

- --- Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/methodobject.c	2011-09-16 19:03:25.113821625 -0400

+ diff --git a/Objects/methodobject.c b/Objects/methodobject.c

+ index c1a99ab2687..ea5df77ae1c 100644

+ --- a/Objects/methodobject.c

+ +++ b/Objects/methodobject.c

  @@ -412,6 +412,15 @@ PyCFunction_Fini(void)

       (void)PyCFunction_ClearFreeList();

   }
@@ -309,10 +365,11 @@ 

   /* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),

      but it's part of the API so we need to keep a function around that

      existing C extensions can call.

- diff -up Python-2.7.2/Objects/object.c.add-debug-malloc-stats Python-2.7.2/Objects/object.c

- --- Python-2.7.2/Objects/object.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/object.c	2011-09-16 19:04:46.463820849 -0400

- @@ -2334,6 +2334,23 @@ PyMem_Free(void *p)

+ diff --git a/Objects/object.c b/Objects/object.c

+ index 65366b0b351..acef3ce32cd 100644

+ --- a/Objects/object.c

+ +++ b/Objects/object.c

+ @@ -2360,6 +2360,23 @@ PyMem_Free(void *p)

       PyMem_FREE(p);

   }

   
@@ -336,10 +393,11 @@ 

   

   /* These methods are used to control infinite recursion in repr, str, print,

      etc.  Container objects that may recursively contain themselves,

- diff -up Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats Python-2.7.2/Objects/obmalloc.c

- --- Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/obmalloc.c	2011-09-16 19:03:25.114821625 -0400

- @@ -508,12 +508,10 @@ static struct arena_object* usable_arena

+ diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c

+ index 2067cf54e74..71da93887cf 100644

+ --- a/Objects/obmalloc.c

+ +++ b/Objects/obmalloc.c

+ @@ -547,12 +547,10 @@ static struct arena_object* usable_arenas = NULL;

   /* Number of arenas allocated that haven't been free()'d. */

   static size_t narenas_currently_allocated = 0;

   
@@ -352,7 +410,7 @@ 

   

   /* Allocate a new arena.  If we run out of memory, return NULL.  Else

    * allocate a new arena, and return the address of an arena_object

- @@ -528,7 +526,7 @@ new_arena(void)

+ @@ -569,7 +567,7 @@ new_arena(void)

   

   #ifdef PYMALLOC_DEBUG

       if (Py_GETENV("PYTHONMALLOCSTATS"))
@@ -361,7 +419,7 @@ 

   #endif

       if (unused_arena_objects == NULL) {

           uint i;

- @@ -588,11 +586,9 @@ new_arena(void)

+ @@ -637,11 +635,9 @@ new_arena(void)

       arenaobj->address = (uptr)address;

   

       ++narenas_currently_allocated;
@@ -373,7 +431,7 @@ 

       arenaobj->freepools = NULL;

       /* pool_address <- first pool-aligned address in the arena

          nfreepools <- number of whole pools that fit after alignment */

- @@ -1694,17 +1690,19 @@ _PyObject_DebugDumpAddress(const void *p

+ @@ -1802,17 +1798,19 @@ _PyObject_DebugDumpAddress(const void *p)

       }

   }

   
@@ -397,7 +455,7 @@ 

   

       /* Write the value with commas. */

       i = 22;

- @@ -1725,17 +1723,32 @@ printone(const char* msg, size_t value)

+ @@ -1833,17 +1831,32 @@ printone(const char* msg, size_t value)

   

       while (i >= 0)

           buf[i--] = ' ';
@@ -433,7 +491,7 @@ 

   {

       uint i;

       const uint numclasses = SMALL_REQUEST_THRESHOLD >> ALIGNMENT_SHIFT;

- @@ -1764,7 +1777,7 @@ _PyObject_DebugMallocStats(void)

+ @@ -1872,7 +1885,7 @@ _PyObject_DebugMallocStats(void)

       size_t total;

       char buf[128];

   
@@ -442,7 +500,7 @@ 

               SMALL_REQUEST_THRESHOLD, numclasses);

   

       for (i = 0; i < numclasses; ++i)

- @@ -1818,10 +1831,10 @@ _PyObject_DebugMallocStats(void)

+ @@ -1926,10 +1939,10 @@ _PyObject_DebugMallocStats(void)

       }

       assert(narenas == narenas_currently_allocated);

   
@@ -455,7 +513,7 @@ 

   

       for (i = 0; i < numclasses; ++i) {

           size_t p = numpools[i];

- @@ -1832,7 +1845,7 @@ _PyObject_DebugMallocStats(void)

+ @@ -1940,7 +1953,7 @@ _PyObject_DebugMallocStats(void)

               assert(b == 0 && f == 0);

               continue;

           }
@@ -464,7 +522,7 @@ 

                           "%11" PY_FORMAT_SIZE_T "u "

                           "%15" PY_FORMAT_SIZE_T "u "

                           "%13" PY_FORMAT_SIZE_T "u\n",

- @@ -1842,36 +1855,35 @@ _PyObject_DebugMallocStats(void)

+ @@ -1950,36 +1963,35 @@ _PyObject_DebugMallocStats(void)

           pool_header_bytes += p * POOL_OVERHEAD;

           quantization += p * ((POOL_SIZE - POOL_OVERHEAD) % size);

       }
@@ -518,10 +576,11 @@ 

   #ifdef Py_USING_MEMORY_DEBUGGER

   /* Make this function last so gcc won't inline it since the definition is

    * after the reference.

- diff -up Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats Python-2.7.2/Objects/setobject.c

- --- Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/setobject.c	2011-09-16 19:03:25.115821625 -0400

- @@ -1088,6 +1088,16 @@ PySet_Fini(void)

+ diff --git a/Objects/setobject.c b/Objects/setobject.c

+ index 31da3dbfecb..da086ab2bdb 100644

+ --- a/Objects/setobject.c

+ +++ b/Objects/setobject.c

+ @@ -1087,6 +1087,16 @@ PySet_Fini(void)

       Py_CLEAR(emptyfrozenset);

   }

   
@@ -538,10 +597,11 @@ 

   static PyObject *

   set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)

   {

- diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats Python-2.7.2/Objects/stringobject.c

- --- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/stringobject.c	2011-09-16 19:03:25.116821625 -0400

- @@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)

+ diff --git a/Objects/stringobject.c b/Objects/stringobject.c

+ index c47d32f4060..b1ffa249745 100644

+ --- a/Objects/stringobject.c

+ +++ b/Objects/stringobject.c

+ @@ -4880,3 +4880,43 @@ void _Py_ReleaseInternedStrings(void)

       PyDict_Clear(interned);

       Py_CLEAR(interned);

   }
@@ -585,9 +645,10 @@ 

  +            "%zi/%zi "

  +            "mortal/immortal\n", mortal_size, immortal_size);

  +}

- diff -up Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats Python-2.7.2/Objects/tupleobject.c

- --- Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/tupleobject.c	2011-09-16 19:03:25.116821625 -0400

+ diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c

+ index 6f4b18cc5c6..e8e44901589 100644

+ --- a/Objects/tupleobject.c

+ +++ b/Objects/tupleobject.c

  @@ -44,6 +44,22 @@ show_track(void)

   }

   #endif
@@ -611,10 +672,11 @@ 

   

   PyObject *

   PyTuple_New(register Py_ssize_t size)

- diff -up Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats Python-2.7.2/Objects/unicodeobject.c

- --- Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats	2011-06-11 11:46:27.000000000 -0400

- +++ Python-2.7.2/Objects/unicodeobject.c	2011-09-16 19:03:25.118821625 -0400

- @@ -8883,6 +8883,12 @@ _PyUnicode_Fini(void)

+ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c

+ index a859fa05214..b6ff83e110e 100644

+ --- a/Objects/unicodeobject.c

+ +++ b/Objects/unicodeobject.c

+ @@ -9018,6 +9018,12 @@ _PyUnicode_Fini(void)

       (void)PyUnicode_ClearFreeList();

   }

   
@@ -627,10 +689,11 @@ 

   #ifdef __cplusplus

   }

   #endif

- diff -up Python-2.7.2/Python/pythonrun.c.add-debug-malloc-stats Python-2.7.2/Python/pythonrun.c

- --- Python-2.7.2/Python/pythonrun.c.add-debug-malloc-stats	2011-09-16 19:03:25.025821626 -0400

- +++ Python-2.7.2/Python/pythonrun.c	2011-09-16 19:03:25.118821625 -0400

- @@ -549,7 +549,7 @@ Py_Finalize(void)

+ diff --git a/Python/pythonrun.c b/Python/pythonrun.c

+ index abdfb146ae5..d9a0e98a9e9 100644

+ --- a/Python/pythonrun.c

+ +++ b/Python/pythonrun.c

+ @@ -562,7 +562,7 @@ Py_Finalize(void)

   #endif /* Py_TRACE_REFS */

   #ifdef PYMALLOC_DEBUG

       if (Py_GETENV("PYTHONMALLOCSTATS"))
@@ -639,10 +702,11 @@ 

   #endif

   

       call_ll_exitfuncs();

- diff -up Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats Python-2.7.2/Python/sysmodule.c

- --- Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats	2011-09-16 19:03:25.007821626 -0400

- +++ Python-2.7.2/Python/sysmodule.c	2011-09-16 19:03:25.119821625 -0400

- @@ -872,6 +872,57 @@ a 11-tuple where the entries in the tupl

+ diff --git a/Python/sysmodule.c b/Python/sysmodule.c

+ index 22238ba8ce4..95bfb40bee7 100644

+ --- a/Python/sysmodule.c

+ +++ b/Python/sysmodule.c

+ @@ -890,6 +890,57 @@ a 11-tuple where the entries in the tuple are counts of:\n\

   extern "C" {

   #endif

   
@@ -700,7 +764,7 @@ 

   #ifdef Py_TRACE_REFS

   /* Defined in objects.c because it uses static globals if that file */

   extern PyObject *_Py_GetObjects(PyObject *, PyObject *);

- @@ -970,6 +1021,8 @@ static PyMethodDef sys_methods[] = {

+ @@ -988,6 +1039,8 @@ static PyMethodDef sys_methods[] = {

       {"settrace",        sys_settrace, METH_O, settrace_doc},

       {"gettrace",        sys_gettrace, METH_NOARGS, gettrace_doc},

       {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc},

@@ -1,7 +1,21 @@ 

- diff -up Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391 Python-2.7.3/Lib/ctypes/__init__.py

- --- Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391	2012-04-20 14:51:19.390990244 -0400

- +++ Python-2.7.3/Lib/ctypes/__init__.py	2012-04-20 14:51:45.141668316 -0400

- @@ -272,11 +272,6 @@ def _reset_cache():

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:38:12 +0200

+ Subject: [PATCH] 00155-avoid-ctypes-thunks.patch

+ 

+ 00155 #

+ Avoid allocating thunks in ctypes unless absolutely necessary, to avoid

+ generating SELinux denials on "import ctypes" and "import uuid" when

+ embedding Python within httpd (rhbz#814391)

+ ---

+  Lib/ctypes/__init__.py | 5 -----

+  1 file changed, 5 deletions(-)

+ 

+ diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py

+ index 88c85ff3887..f4736f2138d 100644

+ --- a/Lib/ctypes/__init__.py

+ +++ b/Lib/ctypes/__init__.py

+ @@ -269,11 +269,6 @@ def _reset_cache():

       # _SimpleCData.c_char_p_from_param

       POINTER(c_char).from_param = c_char_p.from_param

       _pointer_type_cache[None] = c_void_p

@@ -1,7 +1,22 @@ 

- diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath Python-2.7.3/Lib/test/test_gdb.py

- --- Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath	2012-04-30 15:53:57.254045220 -0400

- +++ Python-2.7.3/Lib/test/test_gdb.py	2012-04-30 16:19:19.569941124 -0400

- @@ -54,6 +54,19 @@ def gdb_has_frame_select():

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:39:42 +0200

+ Subject: [PATCH] 00156-gdb-autoload-safepath.patch

+ 

+ 00156 #

+ Recent builds of gdb will only auto-load scripts from certain safe

+ locations.  Turn off this protection when running test_gdb in the selftest

+ suite to ensure that it can load our -gdb.py script (rhbz#817072):

+ Not yet sent upstream

+ ---

+  Lib/test/test_gdb.py | 27 ++++++++++++++++++++++++++-

+  1 file changed, 26 insertions(+), 1 deletion(-)

+ 

+ diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py

+ index b96acc09884..360bad18465 100644

+ --- a/Lib/test/test_gdb.py

+ +++ b/Lib/test/test_gdb.py

+ @@ -132,6 +132,19 @@ def gdb_has_frame_select():

   

   HAS_PYUP_PYDOWN = gdb_has_frame_select()

   
@@ -21,10 +36,7 @@ 

   class DebuggerTests(unittest.TestCase):

   

       """Test that the debugger can debug Python."""

- diff -up Python-2.7.10/Lib/test/test_gdb.py.ms Python-2.7.10/Lib/test/test_gdb.py

- --- Python-2.7.10/Lib/test/test_gdb.py.ms	2015-05-25 17:00:25.028462615 +0200

- +++ Python-2.7.10/Lib/test/test_gdb.py	2015-05-25 17:01:53.166359822 +0200

- @@ -153,6 +153,17 @@ class DebuggerTests(unittest.TestCase):

+ @@ -178,6 +191,17 @@ class DebuggerTests(unittest.TestCase):

   

                       'run']

   
@@ -42,7 +54,7 @@ 

           # GDB as of 7.4 onwards can distinguish between the

           # value of a variable at entry vs current value:

           #   http://sourceware.org/gdb/onlinedocs/gdb/Variables.html

- @@ -167,10 +178,11 @@ class DebuggerTests(unittest.TestCase):

+ @@ -198,10 +222,11 @@ class DebuggerTests(unittest.TestCase):

           else:

               commands += ['backtrace']

   

@@ -1,5 +1,27 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:40:21 +0200

+ Subject: [PATCH] 00165-crypt-module-salt-backport.patch

+ 

+ 00165 #

+ Backport to Python 2 from Python 3.3 of improvements to the "crypt" module

+ adding precanned ways of salting a password (rhbz#835021)

+ Based on r88500 patch to py3k from Python 3.3

+ plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits

+ to docstrings to note that this additional functionality is not standard

+ within 2.7

+ ---

+  Doc/library/crypt.rst  | 113 +++++++++++++++++++++++++++++++++++++----

+  Lib/crypt.py           |  71 ++++++++++++++++++++++++++

+  Lib/test/test_crypt.py |  19 +++++++

+  Modules/Setup.dist     |   2 +-

+  Modules/cryptmodule.c  |   4 +-

+  setup.py               |   2 +-

+  6 files changed, 198 insertions(+), 13 deletions(-)

+  create mode 100644 Lib/crypt.py

+ 

  diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst

- index 91464ef..6ee64d6 100644

+ index 91464efa8fd..6ee64d63598 100644

  --- a/Doc/library/crypt.rst

  +++ b/Doc/library/crypt.rst

  @@ -16,9 +16,9 @@
@@ -145,7 +167,7 @@ 

  +      raise "Hashed version doesn't validate against original"

  diff --git a/Lib/crypt.py b/Lib/crypt.py

  new file mode 100644

- index 0000000..bf0a416

+ index 00000000000..bf0a4160d2c

  --- /dev/null

  +++ b/Lib/crypt.py

  @@ -0,0 +1,71 @@
@@ -221,7 +243,7 @@ 

  +del _result, _method

  +

  diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py

- index 7cd9c71..b061a55 100644

+ index 7cd9c71981a..b061a550506 100644

  --- a/Lib/test/test_crypt.py

  +++ b/Lib/test/test_crypt.py

  @@ -16,6 +16,25 @@ class CryptTestCase(unittest.TestCase):
@@ -251,7 +273,7 @@ 

       test_support.run_unittest(CryptTestCase)

   

  diff --git a/Modules/Setup.dist b/Modules/Setup.dist

- index 2712f06..3ea4f0c 100644

+ index 9a8d630e8ba..a867d6e5176 100644

  --- a/Modules/Setup.dist

  +++ b/Modules/Setup.dist

  @@ -225,7 +225,7 @@ _ssl _ssl.c \
@@ -264,7 +286,7 @@ 

   

   # Some more UNIX dependent modules -- off by default, since these

  diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c

- index 76de54f..7c69ca6 100644

+ index 76de54f034b..7c69ca67138 100644

  --- a/Modules/cryptmodule.c

  +++ b/Modules/cryptmodule.c

  @@ -43,7 +43,7 @@ static PyMethodDef crypt_methods[] = {
@@ -278,10 +300,10 @@ 

  +    Py_InitModule("_crypt", crypt_methods);

   }

  diff --git a/setup.py b/setup.py

- index b787487..c60ac35 100644

+ index 741dd3b5222..761efff449b 100644

  --- a/setup.py

  +++ b/setup.py

- @@ -798,7 +798,7 @@ class PyBuildExt(build_ext):

+ @@ -844,7 +844,7 @@ class PyBuildExt(build_ext):

               libs = ['crypt']

           else:

               libs = []

@@ -1,8 +1,25 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:40:37 +0200

+ Subject: [PATCH] 

+  00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch

+ 

+ 00167 #

+ Don't run any of the stack navigation tests in test_gdb when Python is

+ optimized, since there appear to be many different ways in which gdb can

+ fail to read the PyFrameObject* for arbitrary places in the callstack,

+ presumably due to compiler optimization (rhbz#912025)

+ 

+ Not yet sent upstream

+ ---

+  Lib/test/test_gdb.py | 14 +++-----------

+  1 file changed, 3 insertions(+), 11 deletions(-)

+ 

  diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py

- index 3354b34..10ba0e5 100644

+ index 360bad18465..b2bbe779e81 100644

  --- a/Lib/test/test_gdb.py

  +++ b/Lib/test/test_gdb.py

- @@ -725,11 +725,10 @@ class PyListTests(DebuggerTests):

+ @@ -728,11 +728,10 @@ class PyListTests(DebuggerTests):

                              '   2    \n'

                              '   3    def foo(a, b, c):\n',

                              bt)
@@ -17,7 +34,7 @@ 

       def test_pyup_command(self):

           'Verify that the "py-up" command works'

           bt = self.get_stack_trace(script=self.get_sample_script(),

- @@ -740,7 +739,6 @@ class StackNavigationTests(DebuggerTests):

+ @@ -743,7 +742,6 @@ class StackNavigationTests(DebuggerTests):

       baz\(a, b, c\)

   $''')

   
@@ -25,7 +42,7 @@ 

       def test_down_at_bottom(self):

           'Verify handling of "py-down" at the bottom of the stack'

           bt = self.get_stack_trace(script=self.get_sample_script(),

- @@ -748,9 +746,6 @@ $''')

+ @@ -751,9 +749,6 @@ $''')

           self.assertEndsWith(bt,

                               'Unable to find a newer python frame\n')

   
@@ -35,7 +52,7 @@ 

       def test_up_at_top(self):

           'Verify handling of "py-up" at the top of the stack'

           bt = self.get_stack_trace(script=self.get_sample_script(),

- @@ -758,9 +753,6 @@ $''')

+ @@ -761,9 +756,6 @@ $''')

           self.assertEndsWith(bt,

                               'Unable to find an older python frame\n')

   

@@ -1,7 +1,23 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:40:53 +0200

+ Subject: [PATCH] 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch

+ 

+ 00169 #

+ Use SHA-256 rather than implicitly using MD5 within the challenge handling

+ in multiprocessing.connection

+ 

+ Sent upstream as http://bugs.python.org/issue17258

+ (rhbz#879695)

+ ---

+  Lib/multiprocessing/connection.py | 12 ++++++++++--

+  1 file changed, 10 insertions(+), 2 deletions(-)

+ 

  diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py

+ index 645a26f069e..d4dc6ac19d5 100644

  --- a/Lib/multiprocessing/connection.py

  +++ b/Lib/multiprocessing/connection.py

- @@ -41,6 +41,10 @@

+ @@ -56,6 +56,10 @@ BUFSIZE = 8192

   # A very generous timeout when it comes to local connections...

   CONNECTION_TIMEOUT = 20.

   
@@ -12,7 +28,7 @@ 

   _mmap_counter = itertools.count()

   

   default_family = 'AF_INET'

- @@ -700,12 +704,16 @@

+ @@ -413,12 +417,16 @@ CHALLENGE = b'#CHALLENGE#'

   WELCOME = b'#WELCOME#'

   FAILURE = b'#FAILURE#'

   
@@ -30,7 +46,7 @@ 

       response = connection.recv_bytes(256)        # reject large message

       if response == digest:

           connection.send_bytes(WELCOME)

- @@ -719,7 +727,7 @@

+ @@ -432,7 +440,7 @@ def answer_challenge(connection, authkey):

       message = connection.recv_bytes(256)         # reject large message

       assert message[:len(CHALLENGE)] == CHALLENGE, 'message = %r' % message

       message = message[len(CHALLENGE):]

file modified
+22 -3
@@ -1,5 +1,24 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:41:10 +0200

+ Subject: [PATCH] 00170-gc-assertions.patch

+ 

+ 00170 #

+ In debug builds, try to print repr() when a C-level assert fails in the

+ garbage collector (typically indicating a reference-counting error

+ somewhere else e.g in an extension module)

+ Backported to 2.7 from a patch I sent upstream for py3k

+   http://bugs.python.org/issue9263  (rhbz#614680)

+ hiding the proposed new macros/functions within gcmodule.c to avoid exposing

+ them within the extension API.

+ (rhbz#850013)

+ ---

+  Lib/test/test_gc.py |  48 +++++++++++++++++++-

+  Modules/gcmodule.c  | 108 +++++++++++++++++++++++++++++++++++++-------

+  2 files changed, 138 insertions(+), 18 deletions(-)

+ 

  diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py

- index 7e47b2d..12a210d 100644

+ index 7e47b2d3a27..12a210da7d1 100644

  --- a/Lib/test/test_gc.py

  +++ b/Lib/test/test_gc.py

  @@ -1,7 +1,8 @@
@@ -72,7 +91,7 @@ 

       def setUp(self):

           gc.enable()

  diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c

- index 916e481..0233ce2 100644

+ index 700c1a32b07..e2df829565e 100644

  --- a/Modules/gcmodule.c

  +++ b/Modules/gcmodule.c

  @@ -21,6 +21,73 @@
@@ -268,7 +287,7 @@ 

   

           /* copy-paste of weakrefobject.c's handle_callback() */

           temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);

- @@ -810,7 +884,7 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)

+ @@ -807,7 +881,7 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)

           PyGC_Head *gc = collectable->gc.gc_next;

           PyObject *op = FROM_GC(gc);

   

file modified
+20 -4
@@ -1,7 +1,23 @@ 

- diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c

- --- Python-2.7.3/Modules/getpath.c.fix-for-usr-move	2013-03-06 14:25:32.801828698 -0500

- +++ Python-2.7.3/Modules/getpath.c	2013-03-06 15:59:30.872443168 -0500

- @@ -510,6 +510,24 @@ calculate_path(void)

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:41:24 +0200

+ Subject: [PATCH] 00174-fix-for-usr-move.patch

+ 

+ 00174 #

+ Workaround for failure to set up prefix/exec_prefix when running

+ an embededed libpython that sets Py_SetProgramName() to a name not

+ on $PATH when run from the root directory due to

+   https://fedoraproject.org/wiki/Features/UsrMove

+ e.g. cmpi-bindings under systemd (rhbz#817554):

+ ---

+  Modules/getpath.c | 18 ++++++++++++++++++

+  1 file changed, 18 insertions(+)

+ 

+ diff --git a/Modules/getpath.c b/Modules/getpath.c

+ index 20d1779d937..eca6d69f618 100644

+ --- a/Modules/getpath.c

+ +++ b/Modules/getpath.c

+ @@ -502,6 +502,24 @@ calculate_path(void)

          MAXPATHLEN bytes long.

       */

   

@@ -1,8 +1,20 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:41:39 +0200

+ Subject: [PATCH] 00180-python-add-support-for-ppc64p7.patch

+ 

+ 00180 #

+ Enable building on ppc64p7

+ Not appropriate for upstream, Fedora-specific naming

+ ---

+  config.sub | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

  diff --git a/config.sub b/config.sub

- index 3478c1f..e422173 100755

+ index 40ea5dfe115..932128b337e 100755

  --- a/config.sub

  +++ b/config.sub

- @@ -1040,7 +1040,7 @@ case $basic_machine in

+ @@ -1045,7 +1045,7 @@ case $basic_machine in

   		;;

   	ppc64)	basic_machine=powerpc64-unknown

   		;;

@@ -1,8 +1,24 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:41:50 +0200

+ Subject: [PATCH] 00181-allow-arbitrary-timeout-in-condition-wait.patch

+ 

+ 00181 #

+ Allow arbitrary timeout for Condition.wait, as reported in

+ https://bugzilla.redhat.com/show_bug.cgi?id=917709

+ Upstream doesn't want this: http://bugs.python.org/issue17748

+ But we have no better solution downstream yet, and since there is

+ no API breakage, we apply this patch.

+ Doesn't apply to Python 3, where this is fixed otherwise and works.

+ ---

+  Lib/threading.py | 17 ++++++++++-------

+  1 file changed, 10 insertions(+), 7 deletions(-)

+ 

  diff --git a/Lib/threading.py b/Lib/threading.py

- index cb49c4a..c9795a5 100644

+ index b08374a9639..6ef7f8a7df4 100644

  --- a/Lib/threading.py

  +++ b/Lib/threading.py

- @@ -305,7 +305,7 @@ class _Condition(_Verbose):

+ @@ -306,7 +306,7 @@ class _Condition(_Verbose):

           else:

               return True

   
@@ -11,7 +27,7 @@ 

           """Wait until notified or until a timeout occurs.

   

           If the calling thread has not acquired the lock when this method is

- @@ -354,7 +354,10 @@ class _Condition(_Verbose):

+ @@ -355,7 +355,10 @@ class _Condition(_Verbose):

                       remaining = endtime - _time()

                       if remaining <= 0:

                           break
@@ -23,7 +39,7 @@ 

                       _sleep(delay)

                   if not gotit:

                       if __debug__:

- @@ -599,7 +602,7 @@ class _Event(_Verbose):

+ @@ -594,7 +597,7 @@ class _Event(_Verbose):

           with self.__cond:

               self.__flag = False

   
@@ -32,16 +48,16 @@ 

           """Block until the internal flag is true.

   

           If the internal flag is true on entry, return immediately. Otherwise,

- @@ -617,7 +620,7 @@ class _Event(_Verbose):

+ @@ -611,7 +614,7 @@ class _Event(_Verbose):

           """

           with self.__cond:

               if not self.__flag:

  -                self.__cond.wait(timeout)

  +                self.__cond.wait(timeout, balancing)

               return self.__flag

- 

+  

   # Helper to generate new thread names

- @@ -908,7 +911,7 @@ class Thread(_Verbose):

+ @@ -899,7 +902,7 @@ class Thread(_Verbose):

               if 'dummy_threading' not in _sys.modules:

                   raise

   
@@ -50,7 +66,7 @@ 

           """Wait until the thread terminates.

   

           This blocks the calling thread until the thread whose join() method is

- @@ -957,7 +960,7 @@ class Thread(_Verbose):

+ @@ -948,7 +951,7 @@ class Thread(_Verbose):

                           if __debug__:

                               self._note("%s.join(): timed out", self)

                           break
@@ -59,7 +75,7 @@ 

                   else:

                       if __debug__:

                           self._note("%s.join(): thread stopped", self)

- @@ -1143,7 +1146,7 @@ class _DummyThread(Thread):

+ @@ -1133,7 +1136,7 @@ class _DummyThread(Thread):

       def _set_daemon(self):

           return True

   

@@ -1,7 +1,20 @@ 

- diff -up Python-2.7.5/Lib/urllib2.py.orig Python-2.7.5/Lib/urllib2.py

- --- Python-2.7.5/Lib/urllib2.py.orig	2013-07-17 12:22:58.595525622 +0200

- +++ Python-2.7.5/Lib/urllib2.py	2013-07-17 12:19:59.875898030 +0200

- @@ -728,6 +728,8 @@ class ProxyHandler(BaseHandler):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:42:03 +0200

+ Subject: [PATCH] 00185-urllib2-honors-noproxy-for-ftp.patch

+ 

+ 00185 #

+ Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs

+ when ftp_proxy is set

+ ---

+  Lib/urllib2.py | 2 ++

+  1 file changed, 2 insertions(+)

+ 

+ diff --git a/Lib/urllib2.py b/Lib/urllib2.py

+ index 8b634ada372..fd19e1ae943 100644

+ --- a/Lib/urllib2.py

+ +++ b/Lib/urllib2.py

+ @@ -753,6 +753,8 @@ class ProxyHandler(BaseHandler):

           if proxy_type is None:

               proxy_type = orig_type

   

@@ -1,7 +1,23 @@ 

- diff -r e8b8279ca118 setup.py

- --- a/setup.py	Sun Jul 21 21:57:52 2013 -0400

- +++ b/setup.py	Tue Aug 20 09:45:31 2013 +0200

- @@ -1480,12 +1480,21 @@

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:42:17 +0200

+ Subject: [PATCH] 00187-add-RPATH-to-pyexpat.patch

+ 

+ 00187 #

+ Add an explicit RPATH to pyexpat.so pointing at the directory

+ containing the system expat (which has the extra XML_SetHashSalt

+ symbol), to avoid an ImportError with a link error if there's an

+ LD_LIBRARY_PATH containing a "vanilla" build of expat (without the

+ symbol)

+ ---

+  setup.py | 9 +++++++++

+  1 file changed, 9 insertions(+)

+ 

+ diff --git a/setup.py b/setup.py

+ index 761efff449b..b401ab836a9 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -1536,12 +1536,21 @@ class PyBuildExt(build_ext):

                                'expat/xmltok_impl.h'

                                ]

   

file modified
+13 -1
@@ -1,5 +1,17 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:42:30 +0200

+ Subject: [PATCH] 00189-use-rpm-wheels.patch

+ 

+ 00189 #

+ Instead of bundled wheels, use our RPM packaged wheels from

+ /usr/share/python-wheels

+ ---

+  Lib/ensurepip/__init__.py | 35 ++++++++++++++++++++++++-----------

+  1 file changed, 24 insertions(+), 11 deletions(-)

+ 

  diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py

- index 5021ebf..1903cc0 100644

+ index 09551411847..1903cc010a6 100644

  --- a/Lib/ensurepip/__init__.py

  +++ b/Lib/ensurepip/__init__.py

  @@ -1,9 +1,10 @@

file modified
+12 -1
@@ -1,5 +1,16 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:42:43 +0200

+ Subject: [PATCH] 00191-disable-NOOP.patch

+ 

+ 00191 #

+ Disabling NOOP test as it fails without internet connection

+ ---

+  Lib/test/test_smtplib.py | 1 +

+  1 file changed, 1 insertion(+)

+ 

  diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py

- index 1bb6690..28ed25d 100644

+ index 703b631c175..337a99d0173 100644

  --- a/Lib/test/test_smtplib.py

  +++ b/Lib/test/test_smtplib.py

  @@ -182,6 +182,7 @@ class DebuggingServerTests(unittest.TestCase):

@@ -1,6 +1,22 @@ 

- --- Python-2.7.5/setup.py.orig  2013-05-11 20:32:54.000000000 -0700

- +++ Python-2.7.5/setup.py  2014-02-18 14:16:07.999004901 -0800

- @@ -1168,7 +1168,7 @@ class PyBuildExt(build_ext):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:42:52 +0200

+ Subject: [PATCH] 00193-enable-loading-sqlite-extensions.patch

+ 

+ 00193 #

+ Enable loading sqlite extensions. This patch isn't needed for

+ python3.spec, since Python 3 has a configuration option for this.

+ rhbz#1066708

+ Patch provided by John C. Peterson

+ ---

+  setup.py | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/setup.py b/setup.py

+ index b401ab836a9..abc9c74281e 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -1225,7 +1225,7 @@ class PyBuildExt(build_ext):

                   sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))

   

               # Comment this out if you want the sqlite3 module to be able to load extensions.

@@ -1,8 +1,20 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:43:04 +0200

+ Subject: [PATCH] 00289-disable-nis-detection.patch

+ 

+ 00289 #

+ Disable automatic detection for the nis module

+ (we handle it it in Setup.dist, see Patch0)

+ ---

+  setup.py | 51 +--------------------------------------------------

+  1 file changed, 1 insertion(+), 50 deletions(-)

+ 

  diff --git a/setup.py b/setup.py

- index 585e380..9993f11 100644

+ index abc9c74281e..a8b53a523c9 100644

  --- a/setup.py

  +++ b/setup.py

- @@ -1346,11 +1346,7 @@ class PyBuildExt(build_ext):

+ @@ -1377,11 +1377,7 @@ class PyBuildExt(build_ext):

               else:

                   missing.append('resource')

   
@@ -15,7 +27,7 @@ 

   

           # Curses support, requiring the System V version of curses, often

           # provided by the ncurses library.

- @@ -2162,51 +2158,6 @@ class PyBuildExt(build_ext):

+ @@ -2193,51 +2189,6 @@ class PyBuildExt(build_ext):

               # for dlopen, see bpo-32647

               ext.libraries.append('dl')

   

@@ -1,4 +1,4 @@ 

- From cdee96242ad45e32a2caa46ffb91f0ad57766fc5 Mon Sep 17 00:00:00 2001

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

  From: Rishi <rishi_devan@mail.com>

  Date: Wed, 15 Jul 2020 13:51:00 +0200

  Subject: [PATCH] 00351-cve-2019-20907-fix-infinite-loop-in-tarfile.patch
@@ -17,7 +17,7 @@ 

   create mode 100644 Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst

  

  diff --git a/Lib/tarfile.py b/Lib/tarfile.py

- index adf91d5382..574a6bb279 100644

+ index adf91d53823..574a6bb279d 100644

  --- a/Lib/tarfile.py

  +++ b/Lib/tarfile.py

  @@ -1400,6 +1400,8 @@ class TarInfo(object):
@@ -41,7 +41,7 @@ 

  HcmV?d00001

  

  diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py

- index 89bd738aea..45921562f5 100644

+ index 89bd738aea0..45921562f52 100644

  --- a/Lib/test/test_tarfile.py

  +++ b/Lib/test/test_tarfile.py

  @@ -325,6 +325,13 @@ class CommonReadTest(ReadTest):
@@ -60,11 +60,8 @@ 

               tar = tarfile.open(fileobj=fobj, mode=self.mode)

  diff --git a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst

  new file mode 100644

- index 0000000000..ad26676f8b

+ index 00000000000..ad26676f8b8

  --- /dev/null

  +++ b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst

  @@ -0,0 +1 @@

  +Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907).

- -- 

- 2.26.2

- 

@@ -0,0 +1,113 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: AMIR <31338382+amiremohamadi@users.noreply.github.com>

+ Date: Sun, 19 Jul 2020 00:46:10 +0430

+ Subject: [PATCH] 

+  00354-cve-2020-26116-http-request-method-crlf-injection-in-httplib.patch

+ 

+ 00354 #

+ Reject control chars in HTTP method in httplib.putrequest to prevent

+ HTTP header injection

+ 

+ Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):

+ - https://bugs.python.org/issue39603

+ - https://github.com/python/cpython/pull/18485 (3.10)

+ - https://github.com/python/cpython/pull/21946 (3.5)

+ 

+ Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>

+ ---

+  Lib/httplib.py                                | 16 +++++++++++++

+  Lib/test/test_httplib.py                      | 23 +++++++++++++++++++

+  .../2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst  |  2 ++

+  3 files changed, 41 insertions(+)

+  create mode 100644 Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst

+ 

+ diff --git a/Lib/httplib.py b/Lib/httplib.py

+ index fcc4152aaf2..a63677477d5 100644

+ --- a/Lib/httplib.py

+ +++ b/Lib/httplib.py

+ @@ -257,6 +257,10 @@ _contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f-\xff]')

+  #  _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")

+  # We are more lenient for assumed real world compatibility purposes.

+  

+ +# These characters are not allowed within HTTP method names

+ +# to prevent http header injection.

+ +_contains_disallowed_method_pchar_re = re.compile('[\x00-\x1f]')

+ +

+  # We always set the Content-Length header for these methods because some

+  # servers will otherwise respond with a 411

+  _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}

+ @@ -935,6 +939,8 @@ class HTTPConnection:

+          else:

+              raise CannotSendRequest()

+  

+ +        self._validate_method(method)

+ +

+          # Save the method for use later in the response phase

+          self._method = method

+  

+ @@ -1020,6 +1026,16 @@ class HTTPConnection:

+          # On Python 2, request is already encoded (default)

+          return request

+  

+ +    def _validate_method(self, method):

+ +        """Validate a method name for putrequest."""

+ +        # prevent http header injection

+ +        match = _contains_disallowed_method_pchar_re.search(method)

+ +        if match:

+ +            raise ValueError(

+ +                    "method can't contain control characters. %r "

+ +                    "(found at least %r)"

+ +                    % (method, match.group()))

+ +

+      def _validate_path(self, url):

+          """Validate a url for putrequest."""

+          # Prevent CVE-2019-9740.

+ diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py

+ index d8a57f73530..e295bb796ec 100644

+ --- a/Lib/test/test_httplib.py

+ +++ b/Lib/test/test_httplib.py

+ @@ -385,6 +385,28 @@ class HeaderTests(TestCase):

+                  conn.putheader(name, value)

+  

+  

+ +class HttpMethodTests(TestCase):

+ +    def test_invalid_method_names(self):

+ +        methods = (

+ +            'GET\r',

+ +            'POST\n',

+ +            'PUT\n\r',

+ +            'POST\nValue',

+ +            'POST\nHOST:abc',

+ +            'GET\nrHost:abc\n',

+ +            'POST\rRemainder:\r',

+ +            'GET\rHOST:\n',

+ +            '\nPUT'

+ +        )

+ +

+ +        for method in methods:

+ +            with self.assertRaisesRegexp(

+ +                    ValueError, "method can't contain control characters"):

+ +                conn = httplib.HTTPConnection('example.com')

+ +                conn.sock = FakeSocket(None)

+ +                conn.request(method=method, url="/")

+ +

+ +

+  class BasicTest(TestCase):

+      def test_status_lines(self):

+          # Test HTTP status lines

+ @@ -1010,6 +1032,7 @@ class TunnelTests(TestCase):

+  @test_support.reap_threads

+  def test_main(verbose=None):

+      test_support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,

+ +                              HttpMethodTests,

+                                HTTPTest, HTTPSTest, SourceAddressTest,

+                                TunnelTests)

+  

+ diff --git a/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst b/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst

+ new file mode 100644

+ index 00000000000..990affc3edd

+ --- /dev/null

+ +++ b/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst

+ @@ -0,0 +1,2 @@

+ +Prevent http header injection by rejecting control characters in

+ +http.client.putrequest(...).

file modified
+18 -3
@@ -1,6 +1,21 @@ 

- --- Python-2.5c1/Makefile.pre.in.cflags	2006-08-18 11:05:40.000000000 -0400

- +++ Python-2.5c1/Makefile.pre.in	2006-08-18 11:09:26.000000000 -0400

- @@ -334,7 +334,7 @@

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:14:08 +0200

+ Subject: [PATCH] python-2.5-cflags.patch

+ 

+ 00004 #

+ Add $(CFLAGS) to the linker arguments when linking the "python" binary

+ since some architectures (sparc64) need this (rhbz:199373).

+ Not yet filed upstream

+ ---

+  Makefile.pre.in | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/Makefile.pre.in b/Makefile.pre.in

+ index 2a14f3323bc..24b9d40143f 100644

+ --- a/Makefile.pre.in

+ +++ b/Makefile.pre.in

+ @@ -487,7 +487,7 @@ coverage-report: regen-grammar

   

   # Build the interpreter

   $(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)

file modified
+20 -4
@@ -1,7 +1,23 @@ 

- diff -up Python-2.5.1/Lib/gettext.py.plural Python-2.5.1/Lib/gettext.py

- --- Python-2.5.1/Lib/gettext.py.plural	2007-09-10 11:38:57.000000000 -0400

- +++ Python-2.5.1/Lib/gettext.py	2007-09-10 11:39:00.000000000 -0400

- @@ -299,6 +299,8 @@ class GNUTranslations(NullTranslations):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:14:35 +0200

+ Subject: [PATCH] python-2.5.1-plural-fix.patch

+ 

+ 00006 #

+ Work around a bug in Python' gettext module relating to the "Plural-Forms"

+ header (rhbz:252136)

+ Related to upstream issues:

+   http://bugs.python.org/issue1448060 and http://bugs.python.org/issue1475523

+ though the proposed upstream patches are, alas, different

+ ---

+  Lib/gettext.py | 2 ++

+  1 file changed, 2 insertions(+)

+ 

+ diff --git a/Lib/gettext.py b/Lib/gettext.py

+ index 765cc8c781e..d45947c2bff 100644

+ --- a/Lib/gettext.py

+ +++ b/Lib/gettext.py

+ @@ -374,6 +374,8 @@ class GNUTranslations(NullTranslations):

                       item = item.strip()

                       if not item:

                           continue

@@ -1,24 +1,55 @@ 

- diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding Python-2.5.1/Lib/sqlite3/dbapi2.py

- --- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding	2007-09-14 10:41:50.000000000 -0400

- +++ Python-2.5.1/Lib/sqlite3/dbapi2.py	2007-09-14 10:42:00.000000000 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:14:59 +0200

+ Subject: [PATCH] python-2.5.1-sqlite-encoding.patch

+ 

+ 00007 #

+ This patch was listed in the changelog as:

+  * Fri Sep 14 2007 Jeremy Katz <katzj@redhat.com> - 2.5.1-11

+  - fix encoding of sqlite .py files to work around weird encoding problem

+  in Turkish (#283331)

+ A traceback attached to rhbz 244016 shows the problem most clearly: a

+ traceback on attempting to import the sqlite module, with:

+   "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"

+ This seems to come from Parser/tokenizer.c:check_coding_spec

+ Our patch changes two source files within sqlite3, removing the

+ "coding: ISO-8859-1" specs and character E4 = U+00E4 =

+ LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.

+ 

+ It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is thwarted

+ by the implementation of "tolower" in the Turkish locale; see:

+   https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9

+ 

+ TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that

+ it may be papering over a symptom

+ ---

+  Lib/sqlite3/__init__.py | 3 +--

+  Lib/sqlite3/dbapi2.py   | 3 +--

+  2 files changed, 2 insertions(+), 4 deletions(-)

+ 

+ diff --git a/Lib/sqlite3/__init__.py b/Lib/sqlite3/__init__.py

+ index 41ef2b76dfc..7864134e934 100644

+ --- a/Lib/sqlite3/__init__.py

+ +++ b/Lib/sqlite3/__init__.py

  @@ -1,7 +1,6 @@

- -# -*- coding: iso-8859-1 -*-

-  # pysqlite2/dbapi2.py: the DB-API 2.0 interface

+ -#-*- coding: ISO-8859-1 -*-

+  # pysqlite2/__init__.py: the pysqlite2 package.

   #

- -# Copyright (C) 2004-2005 Gerhard H�ring <gh@ghaering.de>

- +# Copyright (C) 2004-2005 Gerhard Haering <gh@ghaering.de>

+ -# Copyright (C) 2005 Gerhard H�ring <gh@ghaering.de>

+ +# Copyright (C) 2005 Gerhard Haering <gh@ghaering.de>

   #

   # This file is part of pysqlite.

   #

- diff -up Python-2.5.1/Lib/sqlite3/__init__.py.encoding Python-2.5.1/Lib/sqlite3/__init__.py

- --- Python-2.5.1/Lib/sqlite3/__init__.py.encoding	2007-09-14 10:41:47.000000000 -0400

- +++ Python-2.5.1/Lib/sqlite3/__init__.py	2007-09-14 10:42:06.000000000 -0400

+ diff --git a/Lib/sqlite3/dbapi2.py b/Lib/sqlite3/dbapi2.py

+ index 0d4dcaf6207..16847f79262 100644

+ --- a/Lib/sqlite3/dbapi2.py

+ +++ b/Lib/sqlite3/dbapi2.py

  @@ -1,7 +1,6 @@

- -#-*- coding: ISO-8859-1 -*-

-  # pysqlite2/__init__.py: the pysqlite2 package.

+ -# -*- coding: iso-8859-1 -*-

+  # pysqlite2/dbapi2.py: the DB-API 2.0 interface

   #

- -# Copyright (C) 2005 Gerhard H�ring <gh@ghaering.de>

- +# Copyright (C) 2005 Gerhard Haering <gh@ghaering.de>

+ -# Copyright (C) 2004-2005 Gerhard H�ring <gh@ghaering.de>

+ +# Copyright (C) 2004-2005 Gerhard Haering <gh@ghaering.de>

   #

   # This file is part of pysqlite.

   #

file modified
+17 -4
@@ -1,7 +1,20 @@ 

- diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac

- --- Python-2.6/configure.ac.rpath	2008-11-24 02:51:06.000000000 -0500

- +++ Python-2.6/configure.ac	2008-11-24 02:51:21.000000000 -0500

- @@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:17:44 +0200

+ Subject: [PATCH] python-2.6-rpath.patch

+ 

+ 00016 #

+ Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:

+ FIXME: is this for OSF, not Linux?

+ ---

+  configure.ac | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/configure.ac b/configure.ac

+ index efe6922b5de..5930552a4c4 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -948,7 +948,7 @@ if test $enable_shared = "yes"; then

   	  ;;

       OSF*)

   	  LDLIBRARY='libpython$(VERSION).so'

@@ -1,7 +1,21 @@ 

- diff -up Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath Python-2.6.4/Lib/distutils/unixccompiler.py

- --- Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath	2009-09-09 04:34:06.000000000 -0400

- +++ Python-2.6.4/Lib/distutils/unixccompiler.py	2010-03-15 21:33:25.000000000 -0400

- @@ -142,6 +142,16 @@ class UnixCCompiler(CCompiler):

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:18:01 +0200

+ Subject: [PATCH] python-2.6.4-distutils-rpath.patch

+ 

+ 00017 #

+ Fixup distutils/unixccompiler.py to remove standard library path from rpath:

+ Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of

+ super() as it's an old-style class

+ ---

+  Lib/distutils/unixccompiler.py | 10 ++++++++++

+  1 file changed, 10 insertions(+)

+ 

+ diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py

+ index 3af540e5813..1c9cfe89a21 100644

+ --- a/Lib/distutils/unixccompiler.py

+ +++ b/Lib/distutils/unixccompiler.py

+ @@ -85,6 +85,16 @@ class UnixCCompiler(CCompiler):

       if sys.platform == "cygwin":

           exe_extension = ".exe"

   

@@ -1,6 +1,21 @@ 

- diff -up Python-2.7/Lib/sysconfig.py.lib64-sysconfig Python-2.7/Lib/sysconfig.py

- --- Python-2.7/Lib/sysconfig.py.lib64-sysconfig	2010-07-08 14:18:41.386898476 -0400

- +++ Python-2.7/Lib/sysconfig.py	2010-07-08 14:22:02.837896461 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:19:00 +0200

+ Subject: [PATCH] python-2.7-lib64-sysconfig.patch

+ 

+ 00103 #

+ Python 2.7 split out much of the path-handling from distutils/sysconfig.py to

+ a new sysconfig.py (in r77704).

+ We need to make equivalent changes to that new file to ensure that the stdlib

+ and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:

+ ---

+  Lib/sysconfig.py | 18 +++++++++---------

+  1 file changed, 9 insertions(+), 9 deletions(-)

+ 

+ diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py

+ index 9c8350d953d..1ff812f7b96 100644

+ --- a/Lib/sysconfig.py

+ +++ b/Lib/sysconfig.py

  @@ -7,20 +7,20 @@ from os.path import pardir, realpath

   

   _INSTALL_SCHEMES = {

file modified
+79 -4
@@ -1,5 +1,81 @@ 

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:10:19 +0200

+ Subject: [PATCH] python-2.7.1-config.patch

+ 

+ 00000 #

+ Modules/Setup.dist is ultimately used by the "makesetup" script to construct

+ the Makefile and config.c

+ 

+ Upstream leaves many things disabled by default, to try to make it easy as

+ possible to build the code on as many platforms as possible.

+ 

+ TODO: many modules can also now be built by setup.py after the python binary

+ has been built; need to assess if we should instead build things there

+ 

+ We patch it downstream as follows:

+   - various modules are built by default by upstream as static libraries;

+   we built them as shared libraries

+   - build the "readline" module (appears to also be handled by setup.py now)

+   - build the nis module (which needs the tirpc library since glibc 2.26)

+   - enable the build of the following modules:

+     - array arraymodule.c     # array objects

+     - cmath cmathmodule.c # -lm # complex math library functions

+     - math mathmodule.c # -lm # math library functions, e.g. sin()

+     - _struct _struct.c       # binary structure packing/unpacking

+     - time timemodule.c # -lm # time operations and variables

+     - operator operator.c     # operator.add() and similar goodies

+     - _weakref _weakref.c     # basic weak reference support

+     - _testcapi _testcapimodule.c    # Python C API test module

+     - _random _randommodule.c # Random number generator

+     - _collections _collectionsmodule.c # Container types

+     - itertools itertoolsmodule.c

+     - strop stropmodule.c

+     - _functools _functoolsmodule.c

+     - _bisect _bisectmodule.c # Bisection algorithms

+     - unicodedata unicodedata.c    # static Unicode character database

+     - _locale _localemodule.c

+     - fcntl fcntlmodule.c     # fcntl(2) and ioctl(2)

+     - spwd spwdmodule.c               # spwd(3)

+     - grp grpmodule.c         # grp(3)

+     - select selectmodule.c   # select(2); not on ancient System V

+     - mmap mmapmodule.c  # Memory-mapped files

+     - _csv _csv.c  # CSV file helper

+     - _socket socketmodule.c  # Socket module helper for socket(2)

+     - _ssl _ssl.c

+     - crypt cryptmodule.c -lcrypt     # crypt(3)

+     - termios termios.c       # Steen Lumholt's termios module

+     - resource resource.c     # Jeremy Hylton's rlimit interface

+     - audioop audioop.c       # Operations on audio samples

+     - imageop imageop.c       # Operations on images

+     - _md5 md5module.c md5.c

+     - _sha shamodule.c

+     - _sha256 sha256module.c

+     - _sha512 sha512module.c

+     - linuxaudiodev linuxaudiodev.c

+     - timing timingmodule.c

+     - _tkinter _tkinter.c tkappinit.c

+     - dl dlmodule.c

+     - gdbm gdbmmodule.c

+     - _bsddb _bsddb.c

+     - binascii binascii.c

+     - parser parsermodule.c

+     - cStringIO cStringIO.c

+     - cPickle cPickle.c

+     - zlib zlibmodule.c

+     - _multibytecodec cjkcodecs/multibytecodec.c

+     - _codecs_cn cjkcodecs/_codecs_cn.c

+     - _codecs_hk cjkcodecs/_codecs_hk.c

+     - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c

+     - _codecs_jp cjkcodecs/_codecs_jp.c

+     - _codecs_kr cjkcodecs/_codecs_kr.c

+     - _codecs_tw cjkcodecs/_codecs_tw.c

+ ---

+  Modules/Setup.dist | 122 ++++++++++++++++++++++-----------------------

+  1 file changed, 60 insertions(+), 62 deletions(-)

+ 

  diff --git a/Modules/Setup.dist b/Modules/Setup.dist

- index bbc9222..2cf35a9 100644

+ index bbc92221296..2cf35a9640d 100644

  --- a/Modules/Setup.dist

  +++ b/Modules/Setup.dist

  @@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
@@ -264,15 +340,14 @@ 

   

   # multibytecodec is required for all the other CJK codec modules

  -#_multibytecodec cjkcodecs/multibytecodec.c

- -

+ +_multibytecodec cjkcodecs/multibytecodec.c

+  

  -#_codecs_cn cjkcodecs/_codecs_cn.c

  -#_codecs_hk cjkcodecs/_codecs_hk.c

  -#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c

  -#_codecs_jp cjkcodecs/_codecs_jp.c

  -#_codecs_kr cjkcodecs/_codecs_kr.c

  -#_codecs_tw cjkcodecs/_codecs_tw.c

- +_multibytecodec cjkcodecs/multibytecodec.c

- +

  +_codecs_cn cjkcodecs/_codecs_cn.c

  +_codecs_hk cjkcodecs/_codecs_hk.c

  +_codecs_iso2022 cjkcodecs/_codecs_iso2022.c

@@ -1,6 +1,21 @@ 

- diff -up Python-2.7.1/Lib/test/test_abc.py.cache_leak Python-2.7.1/Lib/test/test_abc.py

- --- Python-2.7.1/Lib/test/test_abc.py.cache_leak	2010-12-28 18:06:35.551938356 -0500

- +++ Python-2.7.1/Lib/test/test_abc.py	2010-12-28 18:09:09.021059202 -0500

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:21:51 +0200

+ Subject: [PATCH] python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch

+ 

+ 00128 #

+ 2.7.1 (in r84230) added a test to test_abc which fails if python is

+ configured with COUNT_ALLOCS, which is the case for our debug build

+ (the COUNT_ALLOCS instrumentation keeps "C" alive).

+ Not yet sent upstream

+ ---

+  Lib/test/test_abc.py | 10 ++++++++--

+  1 file changed, 8 insertions(+), 2 deletions(-)

+ 

+ diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py

+ index dbba37cdb6f..967f4e24810 100644

+ --- a/Lib/test/test_abc.py

+ +++ b/Lib/test/test_abc.py

  @@ -3,6 +3,8 @@

   

   """Unit tests for abc.py."""
@@ -10,7 +25,7 @@ 

   import unittest, weakref

   from test import test_support

   

- @@ -229,8 +231,12 @@ class TestABC(unittest.TestCase):

+ @@ -223,8 +225,12 @@ class TestABC(unittest.TestCase):

           # Trigger cache.

           C().f()

           del C

@@ -1,6 +1,31 @@ 

- diff -up Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config Python-2.7.2/Misc/python-config.in

- --- Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config	2011-08-23 18:15:41.832497124 -0400

- +++ Python-2.7.2/Misc/python-config.in	2011-08-23 18:17:25.854490011 -0400

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:22:18 +0200

+ Subject: [PATCH] python-2.7.2-add-extension-suffix-to-python-config.patch

+ 

+ 00130 #

+ Add "--extension-suffix" option to python-config and python-debug-config

+ (rhbz#732808)

+ 

+ This is adapted from 3.2's PEP-3149 support.

+ 

+ Fedora's debug build has some non-standard features (see also patch 112

+ above), though largely shared with Debian/Ubuntu and Windows

+ 

+ In particular, SO in the Makefile is currently always just ".so" for our

+ python 2 optimized builds, but for python 2 debug it should be '_d.so', to

+ distinguish the debug vs optimized ABI, following the pattern in the above

+ patch.

+ 

+ Not yet sent upstream

+ ---

+  Misc/python-config.in | 4 +++-

+  1 file changed, 3 insertions(+), 1 deletion(-)

+ 

+ diff --git a/Misc/python-config.in b/Misc/python-config.in

+ index 896c849f061..c1691efdfa9 100644

+ --- a/Misc/python-config.in

+ +++ b/Misc/python-config.in

  @@ -6,7 +6,7 @@ import getopt

   from distutils import sysconfig

   
@@ -10,7 +35,7 @@ 

   

   def exit_with_usage(code=1):

       print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],

- @@ -54,3 +54,5 @@ for opt in opt_flags:

+ @@ -56,3 +56,5 @@ for opt in opt_flags:

                   libs.extend(getvar('LINKFORSHARED').split())

           print ' '.join(libs)

   

@@ -1,6 +1,21 @@ 

- --- Python-2.7rc1/Modules/socketmodule.c.socketmodule	2010-05-09 10:46:46.000000000 -0400

- +++ Python-2.7rc1/Modules/socketmodule.c	2010-06-07 23:04:19.374234780 -0400

- @@ -4783,6 +4783,61 @@ init_socket(void)

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:17:03 +0200

+ Subject: [PATCH] python-2.7rc1-socketmodule-constants.patch

+ 

+ 00013 #

+ Add various constants to the socketmodule (rhbz#436560):

+ TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to

+ have been sent upstream yet:

+ ---

+  Modules/socketmodule.c | 55 ++++++++++++++++++++++++++++++++++++++++++

+  1 file changed, 55 insertions(+)

+ 

+ diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c

+ index 4d5a8f6f017..e0ac9a34232 100644

+ --- a/Modules/socketmodule.c

+ +++ b/Modules/socketmodule.c

+ @@ -4979,6 +4979,61 @@ init_socket(void)

       PyModule_AddIntConstant(m, "SO_SETFIB", SO_SETFIB);

   #endif

   

@@ -1,7 +1,21 @@ 

- diff -up Python-2.7rc1/Modules/socketmodule.c.socketmodule2 Python-2.7rc1/Modules/socketmodule.c

- --- Python-2.7rc1/Modules/socketmodule.c.socketmodule2	2010-06-07 23:06:59.133498087 -0400

- +++ Python-2.7rc1/Modules/socketmodule.c	2010-06-07 23:11:51.249520087 -0400

- @@ -5253,6 +5253,15 @@ init_socket(void)

+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001

+ From: Fedora Python maintainers <python-devel@lists.fedoraproject.org>

+ Date: Wed, 15 Jul 2020 15:17:24 +0200

+ Subject: [PATCH] python-2.7rc1-socketmodule-constants2.patch

+ 

+ 00014 #

+ Add various constants to the socketmodule (rhbz#436560):

+ TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to

+ have been sent upstream yet:

+ ---

+  Modules/socketmodule.c | 9 +++++++++

+  1 file changed, 9 insertions(+)

+ 

+ diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c

+ index e0ac9a34232..0eec3ac2c04 100644

+ --- a/Modules/socketmodule.c

+ +++ b/Modules/socketmodule.c

+ @@ -5449,6 +5449,15 @@ init_socket(void)

   #ifdef  TCP_QUICKACK

       PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);

   #endif

file modified
+94 -60
@@ -124,7 +124,7 @@ 

  #global prerel ...

  %global upstream_version %{general_version}%{?prerel}

  Version: %{general_version}%{?prerel:~%{prerel}}

- Release: 2%{?dist}

+ Release: 6%{?dist}

  License: Python

  Requires: %{python}-libs%{?_isa} = %{version}-%{release}

  Provides: python(abi) = %{pybasever}
@@ -243,6 +243,9 @@ 

  

  Source7: pynche

  

+ # (Patches taken from github.com/fedora-python/cpython)

+ 

+ # 00000 # eb41a89085f19eab30c9e1f22d09102f3dcab7f0

  # Modules/Setup.dist is ultimately used by the "makesetup" script to construct

  # the Makefile and config.c

  #
@@ -258,35 +261,35 @@ 

  #   - build the "readline" module (appears to also be handled by setup.py now)

  #   - build the nis module (which needs the tirpc library since glibc 2.26)

  #   - enable the build of the following modules:

- #     - array arraymodule.c	# array objects

+ #     - array arraymodule.c     # array objects

  #     - cmath cmathmodule.c # -lm # complex math library functions

  #     - math mathmodule.c # -lm # math library functions, e.g. sin()

- #     - _struct _struct.c	# binary structure packing/unpacking

+ #     - _struct _struct.c       # binary structure packing/unpacking

  #     - time timemodule.c # -lm # time operations and variables

- #     - operator operator.c	# operator.add() and similar goodies

- #     - _weakref _weakref.c	# basic weak reference support

+ #     - operator operator.c     # operator.add() and similar goodies

+ #     - _weakref _weakref.c     # basic weak reference support

  #     - _testcapi _testcapimodule.c    # Python C API test module

- #     - _random _randommodule.c	# Random number generator

+ #     - _random _randommodule.c # Random number generator

  #     - _collections _collectionsmodule.c # Container types

  #     - itertools itertoolsmodule.c

  #     - strop stropmodule.c

  #     - _functools _functoolsmodule.c

- #     - _bisect _bisectmodule.c	# Bisection algorithms

+ #     - _bisect _bisectmodule.c # Bisection algorithms

  #     - unicodedata unicodedata.c    # static Unicode character database

  #     - _locale _localemodule.c

- #     - fcntl fcntlmodule.c	# fcntl(2) and ioctl(2)

- #     - spwd spwdmodule.c		# spwd(3)

- #     - grp grpmodule.c		# grp(3)

- #     - select selectmodule.c	# select(2); not on ancient System V

+ #     - fcntl fcntlmodule.c     # fcntl(2) and ioctl(2)

+ #     - spwd spwdmodule.c               # spwd(3)

+ #     - grp grpmodule.c         # grp(3)

+ #     - select selectmodule.c   # select(2); not on ancient System V

  #     - mmap mmapmodule.c  # Memory-mapped files

  #     - _csv _csv.c  # CSV file helper

  #     - _socket socketmodule.c  # Socket module helper for socket(2)

  #     - _ssl _ssl.c

- #     - crypt cryptmodule.c -lcrypt	# crypt(3)

- #     - termios termios.c	# Steen Lumholt's termios module

- #     - resource resource.c	# Jeremy Hylton's rlimit interface

- #     - audioop audioop.c	# Operations on audio samples

- #     - imageop imageop.c	# Operations on images

+ #     - crypt cryptmodule.c -lcrypt     # crypt(3)

+ #     - termios termios.c       # Steen Lumholt's termios module

+ #     - resource resource.c     # Jeremy Hylton's rlimit interface

+ #     - audioop audioop.c       # Operations on audio samples

+ #     - imageop imageop.c       # Operations on images

  #     - _md5 md5module.c md5.c

  #     - _sha shamodule.c

  #     - _sha256 sha256module.c
@@ -311,19 +314,21 @@ 

  #     - _codecs_tw cjkcodecs/_codecs_tw.c

  Patch0: python-2.7.1-config.patch

  

+ # 00001 # 4cc17cbeaa6c5320d44494c14fe4abe479bf186b

  # Removes the "-g" option from "pydoc", for some reason; I believe

  # (dmalcolm 2010-01-29) that this was introduced in this change:

  # - fix pydoc (#68082)

  # in 2.2.1-12 as a response to the -g option needing TkInter installed

  # (Red Hat Linux 8)

- # Not upstream

  Patch1: 00001-pydocnogui.patch

  

+ # 00004 # 81b93bf369d9d67c71beb5449ff0870f8ac15c7d

  # Add $(CFLAGS) to the linker arguments when linking the "python" binary

  # since some architectures (sparc64) need this (rhbz:199373).

  # Not yet filed upstream

  Patch4: python-2.5-cflags.patch

  

+ # 00006 # bebaf146393db2eb55ea494243a4095ae32eb50d

  # Work around a bug in Python' gettext module relating to the "Plural-Forms"

  # header (rhbz:252136)

  # Related to upstream issues:
@@ -331,6 +336,7 @@ 

  # though the proposed upstream patches are, alas, different

  Patch6: python-2.5.1-plural-fix.patch

  

+ # 00007 # 824c01cf0f2ee2f66cdd8373295431c16b809c5c

  # This patch was listed in the changelog as:

  #  * Fri Sep 14 2007 Jeremy Katz <katzj@redhat.com> - 2.5.1-11

  #  - fix encoding of sqlite .py files to work around weird encoding problem
@@ -351,6 +357,7 @@ 

  # it may be papering over a symptom

  Patch7: python-2.5.1-sqlite-encoding.patch

  

+ # 00010 # 4a21749202ce4e7b8ea716d38c194a997bcf5baa

  # FIXME: Lib/ctypes/util.py posix implementation defines a function

  # _get_soname(f).  Upstreams's implementation of this uses objdump to read the

  # SONAME from a library; we avoid this, apparently to minimize space
@@ -358,25 +365,30 @@ 

  # (rhbz:307221)

  Patch10: 00010-2.7.13-binutils-no-dep.patch

  

- # Upstream as of Python 2.7.3:

- #  Patch11: python-2.7rc1-codec-ascii-tolower.patch

- 

+ # 00013 # 4f2f7b3152a8c3d28441877567051384f23b3e4b

  # Add various constants to the socketmodule (rhbz#436560):

  # TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to

  # have been sent upstream yet:

  Patch13: python-2.7rc1-socketmodule-constants.patch

+ 

+ # 00014 # 250d635a8481bc3bf729567e135d6d9cb4698199

+ # Add various constants to the socketmodule (rhbz#436560):

+ # TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to

+ # have been sent upstream yet:

  Patch14: python-2.7rc1-socketmodule-constants2.patch

  

+ # 00016 # 7ac402c3d2d7f6cd9b98deb0b7138765d31d105a

  # Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:

  # FIXME: is this for OSF, not Linux?

  Patch16: python-2.6-rpath.patch

  

+ # 00017 # c30c4e768942a54dd3a5020c820935f9e2e9fa80

  # Fixup distutils/unixccompiler.py to remove standard library path from rpath:

  # Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of

  # super() as it's an old-style class

  Patch17: python-2.6.4-distutils-rpath.patch

  

- # 00055 #

+ # 00055 # 4cde34923ef71a8c32f8fae50630c90645170500

  # Systemtap support: add statically-defined probe points

  # Patch based on upstream bug: http://bugs.python.org/issue4111

  # fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
@@ -384,31 +396,33 @@ 

  # for 2.7rc1 by dmalcolm:

  Patch55: 00055-systemtap.patch

  

- # Only used when "%%{_lib}" == "lib64"

+ # 00102 # 2242f5aa671eb490b5487dc46dcb05266decfe02

+ # Only used when "%%%%{_lib}" == "lib64"

  # Fixup various paths throughout the build and in distutils from "lib" to "lib64",

  # and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of

  # /usr/lib/pythonMAJOR.MINOR/site-packages

  # Not upstream

  Patch102: 00102-2.7.13-lib64.patch

  

+ # 00103 # ccade12a68954f5bac4d00153ac92e7eee9c2b34

  # Python 2.7 split out much of the path-handling from distutils/sysconfig.py to

  # a new sysconfig.py (in r77704).

  # We need to make equivalent changes to that new file to ensure that the stdlib

  # and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:

  Patch103: python-2.7-lib64-sysconfig.patch

  

- # 00104 #

- # Only used when "%%{_lib}" == "lib64"

+ # 00104 # dc327f751c4f4ad6c2e7ad338e97a8a1e0650b60

+ # Only used when "%%%%{_lib}" == "lib64"

  # Another lib64 fix, for distutils/tests/test_install.py; not upstream:

  Patch104: 00104-lib64-fix-for-test_install.patch

  

- # 00111 #

+ # 00111 # 3dd8cb916b10ea83c0c7d690cf3c7512394a7f66

  # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build

  # a libpythonMAJOR.MINOR.a (bug 550692):

  # Downstream only: not appropriate for upstream

  Patch111: 00111-no-static-lib.patch

  

- # 00112 #

+ # 00112 # 1676b155da8dcacc21fd20006105e3c164a6c5de

  # Patch to support building both optimized vs debug stacks DSO ABIs, sharing

  # the same .py and .pyc files, using "_d.so" to signify a debug build of an

  # extension module.
@@ -469,11 +483,9 @@ 

  #  for these.

  #

  #  See also patch 130 below

- #

  Patch112: 00112-2.7.13-debug-build.patch

  

- 

- # 00113 #

+ # 00113 # 9dd9dbc52d40c76002245bdc718f2d09590615bf

  # Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options

  # described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt

  # so that if they are enabled, they will be in that build's pyconfig.h, so that
@@ -481,12 +493,13 @@ 

  # Not yet sent upstream

  Patch113: 00113-more-configuration-flags.patch

  

- # 00114 #

+ # 00114 # 3cfc26f24a13732fe602a47e389152714b757fd7

  # Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")

  # (rhbz:553020); partially upstream as http://bugs.python.org/issue7647

  # Not yet sent upstream

  Patch114: 00114-statvfs-f_flag-constants.patch

  

+ # 00121 # 15d7dd7ccf99e88ddc9d858cef57b1c91f6871b2

  # Upstream r79310 removed the "Modules" directory from sys.path when Python is

  # running from the build directory on POSIX to fix a unit test (issue #8205).

  # This seems to have broken the compileall.py done in "make install": it cannot
@@ -502,13 +515,14 @@ 

  # This patch adds the build Modules directory to build path.

  Patch121: 00121-add-Modules-to-build-path.patch

  

+ # 00128 # cf4b30b7664a016ba6ee399aad8f65588a7efd79

  # 2.7.1 (in r84230) added a test to test_abc which fails if python is

  # configured with COUNT_ALLOCS, which is the case for our debug build

  # (the COUNT_ALLOCS instrumentation keeps "C" alive).

  # Not yet sent upstream

  Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch

  

- # 00130 #

+ # 00130 # a1595a504aa3fc712856b20bd0850a13b5755762

  # Add "--extension-suffix" option to python-config and python-debug-config

  # (rhbz#732808)

  #
@@ -525,14 +539,14 @@ 

  # Not yet sent upstream

  Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch

  

- # 00131 #

+ # 00131 # aa81f736a8d7cc4315e920bcec3cb5883c67034b

  # The four tests in test_io built on top of check_interrupted_write_retry

  # fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM

  # handlers are never called, and the call to write runs to completion

  # (rhbz#732998)

  Patch131: 00131-disable-tests-in-test_io.patch

  

- # 00132 #

+ # 00132 # 1ec40c78e547fc449ee22a4dbc52562b89115f40

  # Add non-standard hooks to unittest for use in the "check" phase below, when

  # running selftests within the build:

  #   @unittest._skipInRpmBuild(reason)
@@ -546,49 +560,49 @@ 

  # these unittest hooks in their own "check" phases)

  Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch

  

- # 00133 #

+ # 00133 # 434fef9eec3c579fd1ecc956136c1b7cc0b2ea3f

  # "dl" is deprecated, and test_dl doesn't work on 64-bit builds:

  Patch133: 00133-skip-test_dl.patch

  

- # 00136 #

+ # 00136 # 2f7c096e92687ca4ab771802f866588242ba9184

  # Some tests try to seek on sys.stdin, but don't work as expected when run

  # within Koji/mock; skip them within the rpm build:

  Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch

  

- # 00137 #

+ # 00137 # ddb14da3b15a1f6cfda5ab94919f624c91294e00

  # Some tests within distutils fail when run in an rpmbuild:

  Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch

  

- # 00138 #

+ # 00138 # c955cda1742fcfc632c8eaf0b50e4bffb199d33a

  # Fixup some tests within distutils to work with how debug builds are set up:

  Patch138: 00138-fix-distutils-tests-in-debug-build.patch

  

- # 00139 #

+ # 00139 # 38a2e2222cf61623fa5519a652a28537b5cd005d

  # ARM-specific: skip known failure in test_float:

  #  http://bugs.python.org/issue8265 (rhbz#706253)

  Patch139: 00139-skip-test_float-known-failure-on-arm.patch

  

- # 00140 #

+ # 00140 # e5095acfe56937839f02013f9c46cb188784a5b2

  # Sparc-specific: skip known failure in test_ctypes:

  #  http://bugs.python.org/issue8314 (rhbz#711584)

  # which appears to be a libffi bug

  Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch

  

- # 00142 #

+ # 00142 # bcd487be7de5823edd0017bf6778d5e2a0b06c8d

  # Some pty tests fail when run in mock (rhbz#714627):

  Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch

  

- # 00143 #

+ # 00143 # 87bf5bbe4f0c89ec249ee9707bc03ccc9103406c

  # Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid

  # aliasing violations (rhbz#698726)

  # Sent upstream as http://bugs.python.org/issue12872

  Patch143: 00143-tsc-on-ppc.patch

  

- # 00144 #

+ # 00144 # 7a99684f18ea9fc4c00cd2235c623658af36fc97

  # (Optionally) disable the gdbm module:

  Patch144: 00144-no-gdbm.patch

  

- # 00146 #

+ # 00146 # 310ca3207145a5ce6cf414a14650dbafcd7ad215

  # Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)

  # - handle failures from OpenSSL (e.g. on attempts to use MD5 in a

  #   FIPS-enforcing environment)
@@ -606,26 +620,26 @@ 

  # (rhbz#563986)

  Patch146: 00146-hashlib-fips.patch

  

- # 00147 #

+ # 00147 # c77e8f43adbfb44f0a843f06869a36a37415d389

  # Add a sys._debugmallocstats() function

  # Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198

  # Sent upstream as http://bugs.python.org/issue14785

  Patch147: 00147-add-debug-malloc-stats.patch

  

- # 00155 #

+ # 00155 # a154c44f2dfb60419cecaa193ef13e7613dbd488

  # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid

  # generating SELinux denials on "import ctypes" and "import uuid" when

  # embedding Python within httpd (rhbz#814391)

  Patch155: 00155-avoid-ctypes-thunks.patch

  

- # 00156 #

+ # 00156 # a8d1c46e2ab627c493fdcea6d6ba752d9a7bfa2e

  # Recent builds of gdb will only auto-load scripts from certain safe

  # locations.  Turn off this protection when running test_gdb in the selftest

  # suite to ensure that it can load our -gdb.py script (rhbz#817072):

  # Not yet sent upstream

  Patch156: 00156-gdb-autoload-safepath.patch

  

- # 00165 #

+ # 00165 # 38fdabaaa8c5d1576a372a22cdae1f17b65a215f

  # Backport to Python 2 from Python 3.3 of improvements to the "crypt" module

  # adding precanned ways of salting a password (rhbz#835021)

  # Based on r88500 patch to py3k from Python 3.3
@@ -634,7 +648,7 @@ 

  # within 2.7

  Patch165: 00165-crypt-module-salt-backport.patch

  

- # 00167 #

+ # 00167 # 76aea104d5c20527ea08936fb6f2edbb52a07a46

  # Don't run any of the stack navigation tests in test_gdb when Python is

  # optimized, since there appear to be many different ways in which gdb can

  # fail to read the PyFrameObject* for arbitrary places in the callstack,
@@ -643,7 +657,7 @@ 

  # Not yet sent upstream

  Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch

  

- # 00169 #

+ # 00169 # 8d99c73e801c185674c7aee473d3466a118b566a

  # Use SHA-256 rather than implicitly using MD5 within the challenge handling

  # in multiprocessing.connection

  #
@@ -651,7 +665,7 @@ 

  # (rhbz#879695)

  Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch

  

- # 00170 #

+ # 00170 # 029de09ec004fb47f8cbd978f68759e7b4267a38

  # In debug builds, try to print repr() when a C-level assert fails in the

  # garbage collector (typically indicating a reference-counting error

  # somewhere else e.g in an extension module)
@@ -662,7 +676,7 @@ 

  # (rhbz#850013)

  Patch170: 00170-gc-assertions.patch

  

- # 00174 #

+ # 00174 # 149dca2c7ba69102e681d9834ac13c153ca53afc

  # Workaround for failure to set up prefix/exec_prefix when running

  # an embededed libpython that sets Py_SetProgramName() to a name not

  # on $PATH when run from the root directory due to
@@ -670,12 +684,12 @@ 

  # e.g. cmpi-bindings under systemd (rhbz#817554):

  Patch174: 00174-fix-for-usr-move.patch

  

- # 00180 #

+ # 00180 # 7199dba788cff67117e091f6ea84a8e7a98d39fe

  # Enable building on ppc64p7

  # Not appropriate for upstream, Fedora-specific naming

  Patch180: 00180-python-add-support-for-ppc64p7.patch

  

- # 00181 #

+ # 00181 # 4034653bd9e53ead4d73f263d12acf20497b6155

  # Allow arbitrary timeout for Condition.wait, as reported in

  # https://bugzilla.redhat.com/show_bug.cgi?id=917709

  # Upstream doesn't want this: http://bugs.python.org/issue17748
@@ -684,12 +698,12 @@ 

  # Doesn't apply to Python 3, where this is fixed otherwise and works.

  Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch

  

- # 00185 #

+ # 00185 # b104ec8a02f122cfc5c1bdfe923dfe94a6b5079e

  # Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs

  # when ftp_proxy is set

  Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch

  

- # 00187 #

+ # 00187 # f22c50031446603cf938a8003f059190690c8d9a

  # Add an explicit RPATH to pyexpat.so pointing at the directory

  # containing the system expat (which has the extra XML_SetHashSalt

  # symbol), to avoid an ImportError with a link error if there's an
@@ -697,33 +711,45 @@ 

  # symbol)

  Patch187: 00187-add-RPATH-to-pyexpat.patch

  

- # 00189 #

+ # 00189 # 038b390c478fe336a8ea350972785d317bdbbd53

  # Instead of bundled wheels, use our RPM packaged wheels from

  # /usr/share/python-wheels

  Patch189: 00189-use-rpm-wheels.patch

  

- # 00191 #

+ # 00191 # d6f8cb42773c48c480e0639cc8a57aebbf3a4c76

  # Disabling NOOP test as it fails without internet connection

  Patch191: 00191-disable-NOOP.patch

  

- # 00193 #

+ # 00193 # 31a84748ead0945648369d3520369cdd508815e8

  # Enable loading sqlite extensions. This patch isn't needed for

  # python3.spec, since Python 3 has a configuration option for this.

  # rhbz#1066708

  # Patch provided by John C. Peterson

  Patch193: 00193-enable-loading-sqlite-extensions.patch

  

- # 00289 #

+ # 00289 # a923413277ad6331772a93b9daeb85a842ddfc00

  # Disable automatic detection for the nis module

  # (we handle it it in Setup.dist, see Patch0)

  Patch289: 00289-disable-nis-detection.patch

  

- # 00351 #

+ # 00351 # 1ae2a3db6d7af4ea973d1aee285e5fb9f882fdd0

  # Avoid infinite loop when reading specially crafted TAR files using the tarfile module

  # (CVE-2019-20907).

  # See: https://bugs.python.org/issue39017

  Patch351: 00351-cve-2019-20907-fix-infinite-loop-in-tarfile.patch

  

+ # 00354 # 9e9d2c6106446ad107ca1bb6729883c76fefc6eb

+ # Reject control chars in HTTP method in httplib.putrequest to prevent

+ # HTTP header injection

+ #

+ # Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):

+ # - https://bugs.python.org/issue39603

+ # - https://github.com/python/cpython/pull/18485 (3.10)

+ # - https://github.com/python/cpython/pull/21946 (3.5)

+ #

+ # Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>

+ Patch354: 00354-cve-2020-26116-http-request-method-crlf-injection-in-httplib.patch

+ 

  # (New patches go here ^^^)

  #

  # When adding new patches to "python2" and "python3" in Fedora, EL, etc.,
@@ -1056,6 +1082,8 @@ 

  # Patch 351 adds binary file for testing. We need to apply it using Git.

  git apply %{PATCH351}

  

+ %patch354 -p1

+ 

  %if 0%{?_module_build}

  %patch4000 -p1

  %endif
@@ -1954,6 +1982,12 @@ 

  # ======================================================

  

  %changelog

+ * Wed Sep 30 2020 Petr Viktorin <pviktori@redhat.com> - 2.7.18-6

+ - CVE-2020-26116: Reject control chars in HTTP method in httplib.putrequest

+ 

+ * Tue Sep 29 2020 Petr Viktorin <pviktori@redhat.com> - 2.7.18-5

+ - Import patches from GitHub tree

+ 

  * Mon Jul 20 2020 Petr Viktorin <pviktori@redhat.com> - 2.7.18-2

  - Avoid infinite loop when reading specially crafted TAR files (CVE-2019-20907)

    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1856481

To have all the ducks in a row, here's a sync or python2 with python2.7.

Build failed.

Pull-Request has been merged by pviktori

3 years ago
Changes Summary 52
+20 -5
file changed
00001-pydocnogui.patch
+15 -1
file changed
00010-2.7.13-binutils-no-dep.patch
+96 -70
file changed
00055-systemtap.patch
+37 -16
file changed
00102-2.7.13-lib64.patch
+17 -3
file changed
00104-lib64-fix-for-test_install.patch
+20 -6
file changed
00111-no-static-lib.patch
+97 -41
file changed
00112-2.7.13-debug-build.patch
+26 -8
file changed
00113-more-configuration-flags.patch
+18 -4
file changed
00114-statvfs-f_flag-constants.patch
+27 -3
file changed
00121-add-Modules-to-build-path.patch
+19 -4
file changed
00131-disable-tests-in-test_io.patch
+41 -17
file changed
00132-add-rpmbuild-hooks-to-unittest.patch
+16 -4
file changed
00133-skip-test_dl.patch
+17 -4
file changed
00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+16 -5
file changed
00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+20 -8
file changed
00138-fix-distutils-tests-in-debug-build.patch
+17 -4
file changed
00139-skip-test_float-known-failure-on-arm.patch
+18 -4
file changed
00140-skip-test_ctypes-known-failure-on-sparc.patch
+21 -7
file changed
00142-skip-failing-pty-tests-in-rpmbuild.patch
+22 -9
file changed
00143-tsc-on-ppc.patch
+16 -4
file changed
00144-no-gdbm.patch
+109 -74
file changed
00146-hashlib-fips.patch
+170 -106
file changed
00147-add-debug-malloc-stats.patch
+18 -4
file changed
00155-avoid-ctypes-thunks.patch
+21 -9
file changed
00156-gdb-autoload-safepath.patch
+29 -7
file changed
00165-crypt-module-salt-backport.patch
+22 -5
file changed
00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+19 -3
file changed
00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
+22 -3
file changed
00170-gc-assertions.patch
+20 -4
file changed
00174-fix-for-usr-move.patch
+14 -2
file changed
00180-python-add-support-for-ppc64p7.patch
+25 -9
file changed
00181-allow-arbitrary-timeout-in-condition-wait.patch
+17 -4
file changed
00185-urllib2-honors-noproxy-for-ftp.patch
+20 -4
file changed
00187-add-RPATH-to-pyexpat.patch
+13 -1
file changed
00189-use-rpm-wheels.patch
+12 -1
file changed
00191-disable-NOOP.patch
+19 -3
file changed
00193-enable-loading-sqlite-extensions.patch
+15 -3
file changed
00289-disable-nis-detection.patch
+4 -7
file changed
00351-cve-2019-20907-fix-infinite-loop-in-tarfile.patch
+113
file added
00354-cve-2020-26116-http-request-method-crlf-injection-in-httplib.patch
+18 -3
file changed
python-2.5-cflags.patch
+20 -4
file changed
python-2.5.1-plural-fix.patch
+45 -14
file changed
python-2.5.1-sqlite-encoding.patch
+17 -4
file changed
python-2.6-rpath.patch
+18 -4
file changed
python-2.6.4-distutils-rpath.patch
+18 -3
file changed
python-2.7-lib64-sysconfig.patch
+79 -4
file changed
python-2.7.1-config.patch
+19 -4
file changed
python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+29 -4
file changed
python-2.7.2-add-extension-suffix-to-python-config.patch
+18 -3
file changed
python-2.7rc1-socketmodule-constants.patch
+18 -4
file changed
python-2.7rc1-socketmodule-constants2.patch
+94 -60
file changed
python2.spec