Hello community,

here is the log from the commit of package python3 for openSUSE:Factory checked 
in at 2020-03-08 22:22:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3 (Old)
 and      /work/SRC/openSUSE:Factory/.python3.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3"

Sun Mar  8 22:22:28 2020 rev:94 rq:781953 version:3.8.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3/python3-base.changes     2019-06-18 
14:43:05.817751625 +0200
+++ /work/SRC/openSUSE:Factory/.python3.new.26092/python3-base.changes  
2020-03-08 22:22:36.824021052 +0100
@@ -1,0 +2,302 @@
+Thu Mar  5 18:40:29 UTC 2020 - Matej Cepl <[email protected]>
+
+- Update to 3.8.2:
+  - Complete list of changes is available at
+    
https://docs.python.org/release/3.8.2/whatsnew/changelog.html#python-3-8-2-final,
+    but most of them are just bugfixes.
+  - Updated patches:
+    - F00102-lib64.patch
+    - OBS_dev-shm.patch
+    - SUSE-FEDORA-multilib.patch
+    - subprocess-raise-timeout.patch
+
+-------------------------------------------------------------------
+Sun Feb  9 00:14:24 CET 2020 - Matej Cepl <[email protected]>
+
+- Add CVE-2020-8492-urllib-ReDoS.patch fixing the security bug
+  "Python urrlib allowed an HTTP server to conduct Regular
+  Expression Denial of Service (ReDoS)" (bsc#1162367)
+
+-------------------------------------------------------------------
+Sat Feb  8 22:21:10 CET 2020 - Matej Cepl <[email protected]>
+
+- Add Requires: libpython%{so_version} == %{version}-%{release}
+  to python3-base to keep both packages always synchronized
+  (bsc#1162224).
+
+-------------------------------------------------------------------
+Mon Feb  3 20:27:54 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Do not pull in bluez in base again, explain the cycle,
+  it needs to be solved by bluez maintainer for us by providing
+  just the headers separately
+
+-------------------------------------------------------------------
+Mon Feb  3 19:54:25 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Reame idle icons to idle3 in order to not conflict with python2
+  variant of the package
+  * renamed the icons
+  * renamed icon load in desktop file
+
+-------------------------------------------------------------------
+Thu Jan 16 09:50:03 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Add importlib_resources provide/obsolete as it is integral
+  part of the lang since 3.7 release
+
+-------------------------------------------------------------------
+Mon Jan 13 11:10:47 UTC 2020 - Martin Liška <[email protected]>
+
+- Add -fno-semantic-interposition as it brings speed up:
+  https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
+
+-------------------------------------------------------------------
+Thu Dec 19 16:25:26 CET 2019 - Matej Cepl <[email protected]>
+
+- Update to 3.8.1:
+  - This is mainly bugfix release and no significant changes to
+    API are expected. The full changelog is available on
+    https://docs.python.org/3.8/whatsnew/changelog.html#python-3-8-1
+  - Remove bpo-38688_shutil.copytree_prevent-infinite-recursion.patch,
+    which is included in the upstream tarball.
+
+-------------------------------------------------------------------
+Thu Dec 19 14:57:32 CET 2019 - Matej Cepl <[email protected]>
+
+- Add bpo-31046_ensurepip_honours_prefix.patch which makes
+  ensurepip to honour the value of $(prefix). Proposed fix for
+  bpo#31046..
+
+-------------------------------------------------------------------
+Tue Dec 10 11:07:16 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Move bluez-devel dependency to base as it is needed for
+  socket.AF_BLUETOOTH and otherwise does not work
+
+-------------------------------------------------------------------
+Mon Dec  2 16:52:32 CET 2019 - Matej Cepl <[email protected]>
+
+- Reintroduce QtHelp with the help of the new BR
+  python-sphinxcontrib-qthelp.
+
+-------------------------------------------------------------------
+Mon Oct 21 18:51:00 UTC 2019 - Stefan Brüns <[email protected]>
+
+- Fix SUSE-FEDORA-multilib.patch, the platform agnostic infix for
+  library installation is "lib", not "dir".
+
+-------------------------------------------------------------------
+Thu Oct 17 14:19:20 UTC 2019 - Stefan Brüns <[email protected]>
+
+- Move idle subpackage build from python3-base to python3.
+  appstream-glib required for packaging introduces considerable
+  extra dependencies and a build loop via rust/librsvg.
+- Correct installation of idle IDE icons:
+  + idle.png is not the target directory
+  + non-GNOME-specific icons belong into icons/hicolor
+- Add required Name key to idle3 desktop file
+
+-------------------------------------------------------------------
+Tue Oct 15 16:39:12 CEST 2019 - Matej Cepl <[email protected]>
+
+- Update to the final release 3.8.0. .
+  - New Features:
+    - Assignment expressions
+    - Positional-only parameters
+    - Parallel filesystem cache for compiled bytecode files
+    - Debug build uses the same ABI as release build
+    - f-strings support = for self-documenting expressions and
+      debugging
+    - PEP 578: Python Runtime Audit Hooks
+    - PEP 587: Python Initialization Configuration
+    - Vectorcall: a fast calling protocol for CPython
+    - Pickle protocol 5 with out-of-band data buffers
+  - New modules:
+    - importlib.metadata
+  - Improved modules:
+    - ast asyncio, builtins, collections, curses, ctypes,
+      datetime, functools, gc, gettext, gzip, idelib and IDLE,
+      inspect, io, json.tool, math, mmap, multiprocessing, os,
+      os.path, pathlib, pickle, plistlib, py_compile, shlex,
+      shutil, socket, ssl, statistics, sys, tarfile, threading,
+      tokenize, tkinter, time, typing, unicodedata, unittest,
+      venv, weakref, xml
+  - C API improvements
+  - bdist_winnst command has been deprecated (use bdist_wheel)
+- https://docs.python.org/3.8/whatsnew/3.8.html remains rest of
+  changes including documentation on how to port your programs to
+  the current version of Python.
+
+-------------------------------------------------------------------
+Mon Oct 14 15:02:08 CEST 2019 - Matej Cepl <[email protected]>
+
+- Add idle3.appdata.xml and idle3.desktop (originally from
+  Fedora) to make Idle3 full GUI desktop application.
+  (bsc#1153830)
+
+-------------------------------------------------------------------
+Wed Oct  9 19:09:16 UTC 2019 - Michael Gorse <[email protected]>
+
+- Drop intltool from BuildRequires. Doesn't appear to be used.
+
+-------------------------------------------------------------------
+Wed Oct  9 10:37:59 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Add folder version to allow tarball downloads even for beta/rc
+  releases
+
+-------------------------------------------------------------------
+Tue Oct  8 14:53:54 CEST 2019 - Matej Cepl <[email protected]>
+
+- Revert patches from Fedora (F00102-lib64.patch and
+  F00251-change-user-install-location.patch) into their original
+  prisitine Fedora versions, SUSE-FEDORA-multilib.patch refreshed
+  accordingly.
+
+-------------------------------------------------------------------
+Mon Oct  7 14:33:30 UTC 2019 - Matej Cepl <[email protected]>
+
+- Correct quotation of platsubdir in Lib/distutils/command/install.py
+
+-------------------------------------------------------------------
+Thu Oct  3 13:59:57 CEST 2019 - Matej Cepl <[email protected]>
+
+- Replace python-3.6.0-multilib.patch with two patches from
+  Fedora (F00102-lib64.patch and
+  F00251-change-user-install-location.patch), and our own
+  SUSE-FEDORA-multilib.patch to allow better cooperation with
+  Fedora and better upstreaming.
+- Add OBS_dev-shm.patch fixing bpo#38377
+
+-------------------------------------------------------------------
+Thu Oct  3 08:39:18 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Pull in just gettext and let solver to sort out between:
+  gettext-runtime-mini and gettext-runtime
+
+-------------------------------------------------------------------
+Wed Oct  2 15:00:09 CEST 2019 - Matej Cepl <[email protected]>
+
+- Update to 3.8.0rc1. Overall changes from 3.7:
+  - PEP 572, Assignment expressions
+  - PEP 570, Positional-only arguments
+  - PEP 587, Python Initialization Configuration (improved
+    embedding)
+  - PEP 590, Vectorcall: a fast calling protocol for CPython
+  - PEP 578, Runtime audit hooks
+  - PEP 574, Pickle protocol 5 with out-of-band data
+  - Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal
+    types), and PEP 589 (TypedDict)
+  - Parallel filesystem cache for compiled bytecode
+  - Debug builds share ABI as release builds, also the 'm' ABI
+    tag was removed (irrelevant since 3.4), bpo#36707
+  - f-strings support a handy = specifier for debugging
+  - continue is now legal in finally: blocks
+  - on Windows, the default asyncio event loop is now
+    ProactorEventLoop
++++ 142 more lines (skipped)
++++ between /work/SRC/openSUSE:Factory/python3/python3-base.changes
++++ and /work/SRC/openSUSE:Factory/.python3.new.26092/python3-base.changes
python3-doc.changes: same change
python3.changes: same change

Old:
----
  00251-change-user-install-location.patch
  00316-mark-bdist_wininst-unsupported.patch
  CVE-2019-9947-no-ctrl-char-http.patch
  Python-3.7.3.tar.xz
  Python-3.7.3.tar.xz.asc
  python-3.6.0-multilib.patch
  raise_SIGING_not_handled.patch

New:
----
  CVE-2020-8492-urllib-ReDoS.patch
  F00102-lib64.patch
  F00251-change-user-install-location.patch
  OBS_dev-shm.patch
  Python-3.8.2.tar.xz
  Python-3.8.2.tar.xz.asc
  SUSE-FEDORA-multilib.patch
  bpo-31046_ensurepip_honours_prefix.patch
  bpo36302-sort-module-sources.patch
  idle3.appdata.xml
  idle3.desktop

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-base.spec ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.432022661 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.436022664 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-base
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,15 +24,16 @@
 # !!!!
 ### COMMON-DEF-BEGIN ###
 %define         tarversion %{version}
+%define         folderversion %{tarversion}
 %define         tarname    Python-%{tarversion}
 # the versions are autogenerated from pre_checkin.sh
 # based on the current source tarball
-%define         python_version          3.7
-%define         python_version_abitag   37
-%define         python_version_soname   3_7
+%define         python_version          3.8
+%define         python_version_abitag   38
+%define         python_version_soname   3_8
 %define         sitedir         %{_libdir}/python%{python_version}
 # three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149
-%define         abi_kind   m
+%define         abi_kind   %{nil}
 # python ABI version - used in some file names
 %define         python_abi %{python_version}%{abi_kind}
 # soname ABI tag defined in PEP 3149
@@ -40,7 +41,7 @@
 # version part of "libpython" package
 %define         so_major 1
 %define         so_minor 0
-%define         so_version 
%{python_version_soname}%{abi_kind}%{so_major}_%{so_minor}
+%define         so_version 
%{python_version_soname}%{abi_kind}-%{so_major}_%{so_minor}
 # rpm and python have different ideas about what is an arch-dependent name, so:
 %if %{__isa_name} == ppc
 %define archname %(echo %{_arch} | sed s/ppc/powerpc/)
@@ -54,12 +55,17 @@
 # pyexpat.cpython-35m-x86_64-linux-gnu
 # pyexpat.cpython-35m-powerpc64le-linux-gnu
 # pyexpat.cpython-35m-armv7-linux-gnueabihf
+# _md5.cpython-38m-x86_64-linux-gnu.so
 %define dynlib() 
%{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so
 
 # that thing where "without" means "default=on" and vice versa
 %bcond_without testsuite
 # %%if 0%%{?do_profiling}
+%if 0%{?qemu_user_space_build}
+%bcond_with profileopt
+%else
 %bcond_without profileopt
+%endif
 # %%else
 # %%bcond_with    profileopt
 # %%endif
@@ -72,15 +78,15 @@
 ### COMMON-DEF-END ###
 
 Name:           python3-base
-Version:        3.7.3
+Version:        3.8.2
 Release:        0
 Summary:        Python 3 Interpreter and Stdlib Core
 License:        Python-2.0
 Group:          Development/Languages/Python
 URL:            http://www.python.org/
 ##### SOURCE FILES #####
-Source0:        http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz
-Source1:        
http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz.asc
+Source0:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz
+Source1:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz.asc
 Source2:        python.keyring
 Source3:        baselibs.conf
 Source4:        README.SUSE
@@ -95,6 +101,7 @@
 Source102:      pre_checkin.sh
 Source103:      skipped_tests.py
 ##### REQURES, PROVIDES, OBSOLETES #####
+Requires:       libpython%{so_version} == %{version}-%{release}
 Requires:       python-rpm-macros
 Recommends:     python3 = %{version}
 #Recommends:     python3-ensurepip
@@ -111,6 +118,12 @@
 # python3-xml was merged into python3, now moved into -base
 Provides:       python3-xml = %{version}
 Obsoletes:      python3-xml < %{version}
+# python-importlib-metadata was specifical project which was merged into 3.8
+Provides:       python3-importlib-metadata = %{version}
+Obsoletes:      python3-importlib-metadata < %{version}
+# python-importlib_resources is a backport of 3.7 behaviour into older pythons
+Provides:       python3-importlib_resources = %{version}
+Obsoletes:      python3-importlib_resources < %{version}
 ##### BUILDREQUIRES #####
 # SECTION required for basic build
 BuildRequires:  automake
@@ -120,6 +133,9 @@
 # The compression-related ones could be moved to python3 if necessary, with 
the exception of zlib.
 # _bz2
 BuildRequires:  libbz2-devel
+# _socket
+# we just need includes but they need to be split in order to avoid really 
major buildcycles
+#BuildRequires:  bluez-devel-includes
 # pyexpat, _elementtree
 BuildRequires:  libexpat-devel
 # _ctypes
@@ -140,18 +156,31 @@
 BuildRequires:  xz
 # /SECTION
 ### COMMON-PATCH-BEGIN ###
-# support lib-vs-lib64 distinction
-# New version from bpo#34032
-# Unfortunately, the new version is still broken, so we have to use the
-# old one
-Patch02:        python-3.6.0-multilib.patch
+# First series of patches supportin lib-vs-lib64 distinction
+# PATCH-FEATURE-UPSTREAM F00102-lib64.patch bsc#[0-9]+ [email protected]
+# Change the various install paths to use /usr/lib64/ instead or /usr/lib/
+Patch01:        F00102-lib64.patch
+# PATCH-FEATURE-UPSTREAM F00251-change-user-install-location.patch bsc#[0-9]+ 
[email protected]
+# Fix installation in /usr/local (boo#1071941), originally from Fedora
+# 
https://src.fedoraproject.org/rpms/python3/blob/master/f/00251-change-user-install-location.patch
+# Set values of prefix and exec_prefix in distutils install command
+# to /usr/local if executable is /usr/bin/python* and RPM build
+# is not detected to make pip and distutils install into separate location
+Patch02:        F00251-change-user-install-location.patch
+# PATCH-FEATURE-UPSTREAM SUSE-FEDORA-multilib.patch bsc#[0-9]+ [email protected]
+# Add support for platlib variable
+Patch03:        SUSE-FEDORA-multilib.patch
+# PATCH-FIX-OPENSUSE OBS_dev-shm.patch bpo#38377 [email protected]
+# _multiprocessing.SemLock depends on proper /dev/shm which is not available 
in OBS
+Patch04:        OBS_dev-shm.patch
+#
 # PATCH-FEATURE-UPSTREAM distutils-reproducible-compile.patch 
gh#python/cpython#8057 [email protected]
 # Improve reproduceability 
-Patch03:        distutils-reproducible-compile.patch
+Patch06:        distutils-reproducible-compile.patch
 # support finding packages in /usr/local, install to /usr/local by default
-Patch04:        python-3.3.0b1-localpath.patch
+Patch07:        python-3.3.0b1-localpath.patch
 # replace DATE, TIME and COMPILER by fixed definitions to aid reproducible 
builds
-Patch06:        python-3.3.0b1-fix_date_time_compiler.patch
+Patch08:        python-3.3.0b1-fix_date_time_compiler.patch
 # POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test
 Patch09:        python-3.3.0b1-test-posix_fadvise.patch
 # Raise timeout value for test_subprocess
@@ -159,31 +188,23 @@
 # skip some tests only for PowerPC
 Patch23:        skip_random_failing_tests.patch
 # Fix SOURCE_DATE_EPOCH problems (bpo#34022, bpo#29708)
-# gh#python/cpython#10775 and gh#python/cpython#10327
+# gh#python/cpython#10775 gh#python/cpython#10327
 Patch24:        bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch
 Patch25:        python3-imp-returntype.patch
-# PATCH-FIX-UPSTREAM raise_SIGING_not_handled.patch bpo#23395 [email protected]
-# Raise an exception if the SIGINT signal is ignored or not handled
-# gh#python/cpython#7778
-Patch26:        raise_SIGING_not_handled.patch
-# PATCH-FIX-UPSTREAM boo1071941-make-install-in-sep-loc.patch bsc#1071941 
[email protected]
-# Fix installation in /usr/local (boo#1071941), originally from the Fedora VCS.
-#
-# Set values of prefix and exec_prefix in distutils install command
-# to /usr/local if executable is /usr/bin/python* and RPM build
-# is not detected to make pip and distutils install into separate location
-Patch27:        00251-change-user-install-location.patch
 # PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 
[email protected]
 # https://github.com/python/cpython/pull/11569
 # Fix segfault in ssl's cert parser
-Patch28:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
-# PATCH-FIX-UPSTREAM 00316-mark-bdist_wininst-unsupported.patch [email protected]
-# Mark distutils bdist_wininst command unsupported, causing
-# the associated test to be skipped. Originally from the Fedora VCS.
-Patch29:        00316-mark-bdist_wininst-unsupported.patch
-# PATCH-FIX-UPSTREAM CVE-2019-9947-no-ctrl-char-http.patch bsc#1130840 
[email protected]
-# bpo#30458: Disallow control chars in http URLs.
-Patch30:        CVE-2019-9947-no-ctrl-char-http.patch
+Patch27:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
+# PATCH-FIX-UPSTREAM bpo36302-sort-module-sources.patch bsc#1041090 
[email protected]
+# Sort list of sources to have stable order in the compiled .so library.
+Patch28:        bpo36302-sort-module-sources.patch
+# PATCH-FEATURE-UPSTREAM bpo-31046_ensurepip_honours_prefix.patch bpo#31046 
[email protected]
+# ensurepip should honour the value of $(prefix)
+Patch29:        bpo-31046_ensurepip_honours_prefix.patch
+# PATCH-FIX-UPSTREAM CVE-2020-8492-urllib-ReDoS.patch bsc#1162367 
[email protected]
+# Fixes Python urrlib allowed an HTTP server to conduct Regular
+# Expression Denial of Service (ReDoS)
+Patch30:        CVE-2020-8492-urllib-ReDoS.patch
 ### COMMON-PATCH-END ###
 
 %description
@@ -210,18 +231,6 @@
 A number of scripts that are useful for building, testing or extending Python,
 and a set of demonstration programs.
 
-%package -n python3-idle
-Summary:        An Integrated Development Environment for Python
-Group:          Development/Languages/Python
-Requires:       %{name} = %{version}
-Requires:       python3-tk
-
-%description -n python3-idle
-IDLE is a Tkinter based integrated development environment for Python.
-It features a multi-window text editor with multiple undo, Python
-colorizing, and many other things, as well as a Python shell window and
-a debugger.
-
 %package -n python3-devel
 Summary:        Include Files and Libraries Mandatory for Building Python 
Modules
 Group:          Development/Languages/Python
@@ -266,10 +275,18 @@
 %setup -q -n %{tarname}
 
 ### COMMON-PREP-BEGIN ###
+%if "%{_lib}" == "lib64"
+%patch01 -p1
+%endif
 %patch02 -p1
+%if "%{_lib}" == "lib64"
 %patch03 -p1
-%patch04
+%endif
+
+%patch04 -p1
 %patch06 -p1
+%patch07 -p1
+%patch08 -p1
 %patch09 -p1
 # %%patch12 -p1
 %patch15 -p1
@@ -278,7 +295,6 @@
 %endif
 %patch24 -p1
 %patch25 -p1
-%patch26 -p1
 %patch27 -p1
 %patch28 -p1
 %patch29 -p1
@@ -303,16 +319,13 @@
 # drop duplicate README from site-packages
 rm Lib/site-packages/README.txt
 
-# remove unnecessary Windows executables
-rm Lib/distutils/command/wininst-*.exe
-
 ### COMMON-PREP-END ###
 
 %build
 ### COMMON-CONFIG-BEGIN ###
 %define _lto_cflags %{nil}
 # use rpm_opt_flags
-export OPT="%{optflags} -DOPENSSL_LOAD_CONF -fwrapv $(pkg-config 
--cflags-only-I libffi)"
+export OPT="%{optflags} -DOPENSSL_LOAD_CONF -fwrapv $(pkg-config 
--cflags-only-I libffi) -fno-semantic-interposition"
 
 touch -r %{SOURCE0} Makefile.pre.in
 
@@ -337,11 +350,6 @@
 %endif
     --enable-loadable-sqlite-extensions
 
-%ifarch aarch64
-# Builds fail on aarch64 because test_threading locks up
-export PROFILE_TASK="-m test.regrtest --pgo -x test_threading"
-%endif
-
 # prevent make from trying to rebuild PYTHON_FOR_GEN stuff
 make -t Python/Python-ast.c \
         Include/Python-ast.h \
@@ -372,7 +380,7 @@
 mkdir -p 
%{buildroot}%{_prefix}/lib/python%{python_version}/site-packages/__pycache__
 
 # cleanup parts that don't belong
-for dir in curses dbm sqlite3 tkinter; do
+for dir in curses dbm sqlite3 tkinter idlelib; do
     find "%{buildroot}/%{sitedir}/$dir"/* -maxdepth 0 -name "test" -o -exec rm 
-rf {} +
 done
 rm -fv $RPM_BUILD_ROOT%{dynlib nis}
@@ -383,6 +391,9 @@
 # link shared library instead of static library that tools expect
 ln -s ../../libpython%{python_abi}.so 
%{buildroot}%{_libdir}/python%{python_version}/config-%{python_abi}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}/libpython%{python_abi}.so
 
+# delete idle3, which has to many packaging dependencies for base
+rm %{buildroot}%{_bindir}/idle3*
+
 # replace duplicate .pyo/.pyc with hardlinks
 %fdupes %{buildroot}/%{sitedir}
 
@@ -408,16 +419,6 @@
 # install devel files to /config
 #cp Makefile Makefile.pre.in Makefile.pre 
$RPM_BUILD_ROOT%{sitedir}/config-%{python_abi}/
 
-# move idle config into /etc
-install -d -m 755 %{buildroot}%{_sysconfdir}/idle3
-(
-    cd %{buildroot}/%{sitedir}/idlelib/
-    for file in *.def ; do
-        mv $file %{buildroot}%{_sysconfdir}/idle3/
-        ln -sf %{_sysconfdir}/idle3/$file  %{buildroot}/%{sitedir}/idlelib/
-    done
-)
-
 # RPM macros
 mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
 install -m 644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d/ # 
macros.python3
@@ -457,19 +458,6 @@
 %attr(755, root, root)%{_bindir}/2to3-%{python_version}
 %doc %{_docdir}/%{name}/Tools
 
-%files -n python3-idle
-%defattr(644, root, root, 755)
-%{sitedir}/idlelib
-%dir %{_sysconfdir}/idle3
-%config %{_sysconfdir}/idle3/*
-%doc Lib/idlelib/NEWS.txt
-%doc Lib/idlelib/README.txt
-%doc Lib/idlelib/TODO.txt
-%doc Lib/idlelib/extend.txt
-%doc Lib/idlelib/ChangeLog
-%{_bindir}/idle3
-%attr(755, root, root) %{_bindir}/idle%{python_version}
-
 %files -n python3-devel
 %defattr(644, root, root, 755)
 %{_libdir}/libpython%{python_abi}.so
@@ -479,7 +467,7 @@
 %{sitedir}/config-%{python_abi}-*
 %defattr(755, root, root)
 %{_bindir}/python%{python_abi}-config
-%{_bindir}/python%{python_version}-config
+# %%{_bindir}/python%%{python_version}-config
 %{_bindir}/python3-config
 # Own these directories to not depend on gdb
 %dir %{_datadir}/gdb
@@ -496,6 +484,7 @@
 %{dynlib _ctypes_test}
 %{dynlib _testbuffer}
 %{dynlib _testcapi}
+%{dynlib _testinternalcapi}
 %{dynlib _testimportmultiple}
 %{dynlib _testmultiphase}
 %{dynlib xxlimited}
@@ -554,6 +543,7 @@
 %{dynlib ossaudiodev}
 %{dynlib parser}
 %{dynlib _pickle}
+%{dynlib _posixshmem}
 %{dynlib _posixsubprocess}
 %{dynlib pyexpat}
 %{dynlib _queue}
@@ -563,11 +553,13 @@
 %{dynlib _socket}
 %{dynlib spwd}
 %{dynlib _ssl}
+%{dynlib _statistics}
 %{dynlib _struct}
 %{dynlib syslog}
 %{dynlib termios}
 %{dynlib unicodedata}
 %{dynlib _uuid}
+%{dynlib _xxsubinterpreters}
 %{dynlib _xxtestfuzz}
 %{dynlib zlib}
 # hashlib fallback modules
@@ -614,13 +606,11 @@
 %{sitedir}/_import_failed
 %{sitedir}/site-packages/zzzz-import-failed-hooks.pth
 # symlinks
-%{_bindir}/pyvenv
 %{_bindir}/python3
 %{_bindir}/pydoc3
 # executables
 %attr(755, root, root) %{_bindir}/pydoc%{python_version}
-%attr(755, root, root) %{_bindir}/python%{python_abi}
+# %%attr(755, root, root) %%{_bindir}/python%%{python_abi}
 %attr(755, root, root) %{_bindir}/python%{python_version}
-%attr(755, root, root) %{_bindir}/pyvenv-%{python_version}
 
 %changelog

++++++ python3-doc.spec ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.452022674 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.456022676 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-doc
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,15 +18,16 @@
 
 ### COMMON-DEF-BEGIN ###
 %define         tarversion %{version}
+%define         folderversion %{tarversion}
 %define         tarname    Python-%{tarversion}
 # the versions are autogenerated from pre_checkin.sh
 # based on the current source tarball
-%define         python_version          3.7
-%define         python_version_abitag   37
-%define         python_version_soname   3_7
+%define         python_version          3.8
+%define         python_version_abitag   38
+%define         python_version_soname   3_8
 %define         sitedir         %{_libdir}/python%{python_version}
 # three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149
-%define         abi_kind   m
+%define         abi_kind   %{nil}
 # python ABI version - used in some file names
 %define         python_abi %{python_version}%{abi_kind}
 # soname ABI tag defined in PEP 3149
@@ -34,7 +35,7 @@
 # version part of "libpython" package
 %define         so_major 1
 %define         so_minor 0
-%define         so_version 
%{python_version_soname}%{abi_kind}%{so_major}_%{so_minor}
+%define         so_version 
%{python_version_soname}%{abi_kind}-%{so_major}_%{so_minor}
 # rpm and python have different ideas about what is an arch-dependent name, so:
 %if %{__isa_name} == ppc
 %define archname %(echo %{_arch} | sed s/ppc/powerpc/)
@@ -48,12 +49,17 @@
 # pyexpat.cpython-35m-x86_64-linux-gnu
 # pyexpat.cpython-35m-powerpc64le-linux-gnu
 # pyexpat.cpython-35m-armv7-linux-gnueabihf
+# _md5.cpython-38m-x86_64-linux-gnu.so
 %define dynlib() 
%{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so
 
 # that thing where "without" means "default=on" and vice versa
 %bcond_without testsuite
 # %%if 0%%{?do_profiling}
+%if 0%{?qemu_user_space_build}
+%bcond_with profileopt
+%else
 %bcond_without profileopt
+%endif
 # %%else
 # %%bcond_with    profileopt
 # %%endif
@@ -66,31 +72,49 @@
 ### COMMON-DEF-END ###
 #
 Name:           python3-doc
-Version:        3.7.3
+Version:        3.8.2
 Release:        0
 Summary:        Additional Package Documentation for Python 3
 License:        Python-2.0
 Group:          Documentation/HTML
 URL:            http://www.python.org/
-Source0:        
http://www.python.org/ftp/python/%{tarversion}/%{tarname}.tar.xz
-BuildRequires:  python3-Sphinx >= 1.2
+Source0:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz
+Source1:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz.asc
+Source99:       python.keyring
+BuildRequires:  libqt5-qttools
+BuildRequires:  python3-Sphinx >= 1.8
+BuildRequires:  python3-python-docs-theme
+BuildRequires:  python3-sphinxcontrib-qthelp >= 1.0.2
 BuildRequires:  xz
 Enhances:       python3 = %{python_version}
 BuildArch:      noarch
 # for consistency:
 ### COMMON-PATCH-BEGIN ###
-# support lib-vs-lib64 distinction
-# New version from bpo#34032
-# Unfortunately, the new version is still broken, so we have to use the
-# old one
-Patch02:        python-3.6.0-multilib.patch
+# First series of patches supportin lib-vs-lib64 distinction
+# PATCH-FEATURE-UPSTREAM F00102-lib64.patch bsc#[0-9]+ [email protected]
+# Change the various install paths to use /usr/lib64/ instead or /usr/lib/
+Patch01:        F00102-lib64.patch
+# PATCH-FEATURE-UPSTREAM F00251-change-user-install-location.patch bsc#[0-9]+ 
[email protected]
+# Fix installation in /usr/local (boo#1071941), originally from Fedora
+# 
https://src.fedoraproject.org/rpms/python3/blob/master/f/00251-change-user-install-location.patch
+# Set values of prefix and exec_prefix in distutils install command
+# to /usr/local if executable is /usr/bin/python* and RPM build
+# is not detected to make pip and distutils install into separate location
+Patch02:        F00251-change-user-install-location.patch
+# PATCH-FEATURE-UPSTREAM SUSE-FEDORA-multilib.patch bsc#[0-9]+ [email protected]
+# Add support for platlib variable
+Patch03:        SUSE-FEDORA-multilib.patch
+# PATCH-FIX-OPENSUSE OBS_dev-shm.patch bpo#38377 [email protected]
+# _multiprocessing.SemLock depends on proper /dev/shm which is not available 
in OBS
+Patch04:        OBS_dev-shm.patch
+#
 # PATCH-FEATURE-UPSTREAM distutils-reproducible-compile.patch 
gh#python/cpython#8057 [email protected]
 # Improve reproduceability 
-Patch03:        distutils-reproducible-compile.patch
+Patch06:        distutils-reproducible-compile.patch
 # support finding packages in /usr/local, install to /usr/local by default
-Patch04:        python-3.3.0b1-localpath.patch
+Patch07:        python-3.3.0b1-localpath.patch
 # replace DATE, TIME and COMPILER by fixed definitions to aid reproducible 
builds
-Patch06:        python-3.3.0b1-fix_date_time_compiler.patch
+Patch08:        python-3.3.0b1-fix_date_time_compiler.patch
 # POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test
 Patch09:        python-3.3.0b1-test-posix_fadvise.patch
 # Raise timeout value for test_subprocess
@@ -98,31 +122,23 @@
 # skip some tests only for PowerPC
 Patch23:        skip_random_failing_tests.patch
 # Fix SOURCE_DATE_EPOCH problems (bpo#34022, bpo#29708)
-# gh#python/cpython#10775 and gh#python/cpython#10327
+# gh#python/cpython#10775 gh#python/cpython#10327
 Patch24:        bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch
 Patch25:        python3-imp-returntype.patch
-# PATCH-FIX-UPSTREAM raise_SIGING_not_handled.patch bpo#23395 [email protected]
-# Raise an exception if the SIGINT signal is ignored or not handled
-# gh#python/cpython#7778
-Patch26:        raise_SIGING_not_handled.patch
-# PATCH-FIX-UPSTREAM boo1071941-make-install-in-sep-loc.patch bsc#1071941 
[email protected]
-# Fix installation in /usr/local (boo#1071941), originally from the Fedora VCS.
-#
-# Set values of prefix and exec_prefix in distutils install command
-# to /usr/local if executable is /usr/bin/python* and RPM build
-# is not detected to make pip and distutils install into separate location
-Patch27:        00251-change-user-install-location.patch
 # PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 
[email protected]
 # https://github.com/python/cpython/pull/11569
 # Fix segfault in ssl's cert parser
-Patch28:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
-# PATCH-FIX-UPSTREAM 00316-mark-bdist_wininst-unsupported.patch [email protected]
-# Mark distutils bdist_wininst command unsupported, causing
-# the associated test to be skipped. Originally from the Fedora VCS.
-Patch29:        00316-mark-bdist_wininst-unsupported.patch
-# PATCH-FIX-UPSTREAM CVE-2019-9947-no-ctrl-char-http.patch bsc#1130840 
[email protected]
-# bpo#30458: Disallow control chars in http URLs.
-Patch30:        CVE-2019-9947-no-ctrl-char-http.patch
+Patch27:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
+# PATCH-FIX-UPSTREAM bpo36302-sort-module-sources.patch bsc#1041090 
[email protected]
+# Sort list of sources to have stable order in the compiled .so library.
+Patch28:        bpo36302-sort-module-sources.patch
+# PATCH-FEATURE-UPSTREAM bpo-31046_ensurepip_honours_prefix.patch bpo#31046 
[email protected]
+# ensurepip should honour the value of $(prefix)
+Patch29:        bpo-31046_ensurepip_honours_prefix.patch
+# PATCH-FIX-UPSTREAM CVE-2020-8492-urllib-ReDoS.patch bsc#1162367 
[email protected]
+# Fixes Python urrlib allowed an HTTP server to conduct Regular
+# Expression Denial of Service (ReDoS)
+Patch30:        CVE-2020-8492-urllib-ReDoS.patch
 ### COMMON-PATCH-END ###
 
 %description
@@ -145,10 +161,18 @@
 
 # for consistency
 ### COMMON-PREP-BEGIN ###
+%if "%{_lib}" == "lib64"
+%patch01 -p1
+%endif
 %patch02 -p1
+%if "%{_lib}" == "lib64"
 %patch03 -p1
-%patch04
+%endif
+
+%patch04 -p1
 %patch06 -p1
+%patch07 -p1
+%patch08 -p1
 %patch09 -p1
 # %%patch12 -p1
 %patch15 -p1
@@ -157,7 +181,6 @@
 %endif
 %patch24 -p1
 %patch25 -p1
-%patch26 -p1
 %patch27 -p1
 %patch28 -p1
 %patch29 -p1
@@ -182,9 +205,6 @@
 # drop duplicate README from site-packages
 rm Lib/site-packages/README.txt
 
-# remove unnecessary Windows executables
-rm Lib/distutils/command/wininst-*.exe
-
 ### COMMON-PREP-END ###
 
 %build
@@ -194,6 +214,9 @@
 cd Doc
 sed -i "s/^today = .*/today = '$TODAY_DATE'/" conf.py
 make -j1 html
+# create a .qch file that can be used in QtAssistant or KDevelop
+sphinx-build -a -b qthelp . build/qthelp
+qhelpgenerator-qt5 build/qthelp/Python.qhp -o build/qthelp/Python.qch
 
 # Build also devhelp files
 sphinx-build -a -b devhelp . build/devhelp
@@ -205,6 +228,7 @@
 # generated docs
 rm Doc/build/*/.buildinfo
 cp -r Doc/build/html $PDOCS
+install -m 644 Doc/build/qthelp/Python.qch $PDOCS
 # misc
 install -d -m 755 $PDOCS/Misc
 rm Misc/README.AIX
@@ -221,6 +245,7 @@
 %dir %{_docdir}/python3
 %doc %{_docdir}/python3/Misc
 %doc %{_docdir}/python3/html
+%doc %{_docdir}/python3/Python.qch
 
 %files devhelp
 %dir %{_datadir}/gtk-doc

++++++ python3.spec ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.468022684 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.472022686 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -23,15 +23,16 @@
 #
 ### COMMON-DEF-BEGIN ###
 %define         tarversion %{version}
+%define         folderversion %{tarversion}
 %define         tarname    Python-%{tarversion}
 # the versions are autogenerated from pre_checkin.sh
 # based on the current source tarball
-%define         python_version          3.7
-%define         python_version_abitag   37
-%define         python_version_soname   3_7
+%define         python_version          3.8
+%define         python_version_abitag   38
+%define         python_version_soname   3_8
 %define         sitedir         %{_libdir}/python%{python_version}
 # three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149
-%define         abi_kind   m
+%define         abi_kind   %{nil}
 # python ABI version - used in some file names
 %define         python_abi %{python_version}%{abi_kind}
 # soname ABI tag defined in PEP 3149
@@ -39,7 +40,7 @@
 # version part of "libpython" package
 %define         so_major 1
 %define         so_minor 0
-%define         so_version 
%{python_version_soname}%{abi_kind}%{so_major}_%{so_minor}
+%define         so_version 
%{python_version_soname}%{abi_kind}-%{so_major}_%{so_minor}
 # rpm and python have different ideas about what is an arch-dependent name, so:
 %if %{__isa_name} == ppc
 %define archname %(echo %{_arch} | sed s/ppc/powerpc/)
@@ -53,12 +54,17 @@
 # pyexpat.cpython-35m-x86_64-linux-gnu
 # pyexpat.cpython-35m-powerpc64le-linux-gnu
 # pyexpat.cpython-35m-armv7-linux-gnueabihf
+# _md5.cpython-38m-x86_64-linux-gnu.so
 %define dynlib() 
%{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}.so
 
 # that thing where "without" means "default=on" and vice versa
 %bcond_without testsuite
 # %%if 0%%{?do_profiling}
+%if 0%{?qemu_user_space_build}
+%bcond_with profileopt
+%else
 %bcond_without profileopt
+%endif
 # %%else
 # %%bcond_with    profileopt
 # %%endif
@@ -71,22 +77,23 @@
 ### COMMON-DEF-END ###
 #
 Name:           python3
-Version:        3.7.3
+Version:        3.8.2
 Release:        0
 Summary:        Python 3 Interpreter
 License:        Python-2.0
 Group:          Development/Languages/Python
 URL:            http://www.python.org/
-Source0:        http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz
-Source1:        
http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz.asc
+Source0:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz
+Source1:        
http://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz.asc
+Source20:       idle3.desktop
+Source21:       idle3.appdata.xml
+Source99:       python.keyring
 BuildRequires:  automake
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  gdbm-devel
-# Not using gettext-tools to avoid pulling glib2 dependencies to the chain
-BuildRequires:  gettext-runtime-mini
+BuildRequires:  gettext
 BuildRequires:  gmp-devel
-BuildRequires:  intltool
 BuildRequires:  libbz2-devel
 BuildRequires:  libexpat-devel
 BuildRequires:  libffi-devel
@@ -94,7 +101,6 @@
 BuildRequires:  libnsl-devel
 BuildRequires:  libtirpc-devel
 %endif
-BuildRequires:  bluez-devel
 BuildRequires:  lzma-devel
 BuildRequires:  ncurses-devel
 BuildRequires:  netcfg
@@ -106,6 +112,9 @@
 BuildRequires:  tk-devel
 BuildRequires:  xz
 BuildRequires:  pkgconfig(x11)
+# required for idle3 (.desktop and .appdata.xml files)
+BuildRequires:  appstream-glib
+BuildRequires:  update-desktop-files
 Requires:       python3-base = %{version}
 Recommends:     python3-curses
 Recommends:     python3-dbm
@@ -118,18 +127,31 @@
 # see PACKAGING-NOTES for details
 #
 ### COMMON-PATCH-BEGIN ###
-# support lib-vs-lib64 distinction
-# New version from bpo#34032
-# Unfortunately, the new version is still broken, so we have to use the
-# old one
-Patch02:        python-3.6.0-multilib.patch
+# First series of patches supportin lib-vs-lib64 distinction
+# PATCH-FEATURE-UPSTREAM F00102-lib64.patch bsc#[0-9]+ [email protected]
+# Change the various install paths to use /usr/lib64/ instead or /usr/lib/
+Patch01:        F00102-lib64.patch
+# PATCH-FEATURE-UPSTREAM F00251-change-user-install-location.patch bsc#[0-9]+ 
[email protected]
+# Fix installation in /usr/local (boo#1071941), originally from Fedora
+# 
https://src.fedoraproject.org/rpms/python3/blob/master/f/00251-change-user-install-location.patch
+# Set values of prefix and exec_prefix in distutils install command
+# to /usr/local if executable is /usr/bin/python* and RPM build
+# is not detected to make pip and distutils install into separate location
+Patch02:        F00251-change-user-install-location.patch
+# PATCH-FEATURE-UPSTREAM SUSE-FEDORA-multilib.patch bsc#[0-9]+ [email protected]
+# Add support for platlib variable
+Patch03:        SUSE-FEDORA-multilib.patch
+# PATCH-FIX-OPENSUSE OBS_dev-shm.patch bpo#38377 [email protected]
+# _multiprocessing.SemLock depends on proper /dev/shm which is not available 
in OBS
+Patch04:        OBS_dev-shm.patch
+#
 # PATCH-FEATURE-UPSTREAM distutils-reproducible-compile.patch 
gh#python/cpython#8057 [email protected]
 # Improve reproduceability 
-Patch03:        distutils-reproducible-compile.patch
+Patch06:        distutils-reproducible-compile.patch
 # support finding packages in /usr/local, install to /usr/local by default
-Patch04:        python-3.3.0b1-localpath.patch
+Patch07:        python-3.3.0b1-localpath.patch
 # replace DATE, TIME and COMPILER by fixed definitions to aid reproducible 
builds
-Patch06:        python-3.3.0b1-fix_date_time_compiler.patch
+Patch08:        python-3.3.0b1-fix_date_time_compiler.patch
 # POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test
 Patch09:        python-3.3.0b1-test-posix_fadvise.patch
 # Raise timeout value for test_subprocess
@@ -137,31 +159,23 @@
 # skip some tests only for PowerPC
 Patch23:        skip_random_failing_tests.patch
 # Fix SOURCE_DATE_EPOCH problems (bpo#34022, bpo#29708)
-# gh#python/cpython#10775 and gh#python/cpython#10327
+# gh#python/cpython#10775 gh#python/cpython#10327
 Patch24:        bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch
 Patch25:        python3-imp-returntype.patch
-# PATCH-FIX-UPSTREAM raise_SIGING_not_handled.patch bpo#23395 [email protected]
-# Raise an exception if the SIGINT signal is ignored or not handled
-# gh#python/cpython#7778
-Patch26:        raise_SIGING_not_handled.patch
-# PATCH-FIX-UPSTREAM boo1071941-make-install-in-sep-loc.patch bsc#1071941 
[email protected]
-# Fix installation in /usr/local (boo#1071941), originally from the Fedora VCS.
-#
-# Set values of prefix and exec_prefix in distutils install command
-# to /usr/local if executable is /usr/bin/python* and RPM build
-# is not detected to make pip and distutils install into separate location
-Patch27:        00251-change-user-install-location.patch
 # PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 
[email protected]
 # https://github.com/python/cpython/pull/11569
 # Fix segfault in ssl's cert parser
-Patch28:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
-# PATCH-FIX-UPSTREAM 00316-mark-bdist_wininst-unsupported.patch [email protected]
-# Mark distutils bdist_wininst command unsupported, causing
-# the associated test to be skipped. Originally from the Fedora VCS.
-Patch29:        00316-mark-bdist_wininst-unsupported.patch
-# PATCH-FIX-UPSTREAM CVE-2019-9947-no-ctrl-char-http.patch bsc#1130840 
[email protected]
-# bpo#30458: Disallow control chars in http URLs.
-Patch30:        CVE-2019-9947-no-ctrl-char-http.patch
+Patch27:        CVE-2019-5010-null-defer-x509-cert-DOS.patch
+# PATCH-FIX-UPSTREAM bpo36302-sort-module-sources.patch bsc#1041090 
[email protected]
+# Sort list of sources to have stable order in the compiled .so library.
+Patch28:        bpo36302-sort-module-sources.patch
+# PATCH-FEATURE-UPSTREAM bpo-31046_ensurepip_honours_prefix.patch bpo#31046 
[email protected]
+# ensurepip should honour the value of $(prefix)
+Patch29:        bpo-31046_ensurepip_honours_prefix.patch
+# PATCH-FIX-UPSTREAM CVE-2020-8492-urllib-ReDoS.patch bsc#1162367 
[email protected]
+# Fixes Python urrlib allowed an HTTP server to conduct Regular
+# Expression Denial of Service (ReDoS)
+Patch30:        CVE-2020-8492-urllib-ReDoS.patch
 ### COMMON-PATCH-END ###
 
 %description
@@ -184,8 +198,7 @@
 Requires:       %{name} = %{version}
 
 %description tk
-Python interface to Tk. Tk is the GUI toolkit that comes with Tcl. The
-"xrpm" package uses this Python interface.
+Python interface to Tk. Tk is the GUI toolkit that comes with Tcl.
 
 %package curses
 Summary:        Python Interface to the (N)Curses Library
@@ -205,13 +218,33 @@
 An easy to use interface for Unix DBM databases, and more specifically,
 the GNU implementation GDBM.
 
+%package idle
+Summary:        An Integrated Development Environment for Python
+Group:          Development/Languages/Python
+Requires:       %{name} = %{version}
+Requires:       python3-tk
+
+%description idle
+IDLE is a Tkinter based integrated development environment for Python.
+It features a multi-window text editor with multiple undo, Python
+colorizing, and many other things, as well as a Python shell window and
+a debugger.
+
 %prep
 %setup -q -n %{tarname}
 ### COMMON-PREP-BEGIN ###
+%if "%{_lib}" == "lib64"
+%patch01 -p1
+%endif
 %patch02 -p1
+%if "%{_lib}" == "lib64"
 %patch03 -p1
-%patch04
+%endif
+
+%patch04 -p1
 %patch06 -p1
+%patch07 -p1
+%patch08 -p1
 %patch09 -p1
 # %%patch12 -p1
 %patch15 -p1
@@ -220,7 +253,6 @@
 %endif
 %patch24 -p1
 %patch25 -p1
-%patch26 -p1
 %patch27 -p1
 %patch28 -p1
 %patch29 -p1
@@ -245,16 +277,13 @@
 # drop duplicate README from site-packages
 rm Lib/site-packages/README.txt
 
-# remove unnecessary Windows executables
-rm Lib/distutils/command/wininst-*.exe
-
 ### COMMON-PREP-END ###
 
 %build
 ### COMMON-CONFIG-BEGIN ###
 %define _lto_cflags %{nil}
 # use rpm_opt_flags
-export OPT="%{optflags} -DOPENSSL_LOAD_CONF -fwrapv $(pkg-config 
--cflags-only-I libffi)"
+export OPT="%{optflags} -DOPENSSL_LOAD_CONF -fwrapv $(pkg-config 
--cflags-only-I libffi) -fno-semantic-interposition"
 
 touch -r %{SOURCE0} Makefile.pre.in
 
@@ -279,11 +308,6 @@
 %endif
     --enable-loadable-sqlite-extensions
 
-%ifarch aarch64
-# Builds fail on aarch64 because test_threading locks up
-export PROFILE_TASK="-m test.regrtest --pgo -x test_threading"
-%endif
-
 # prevent make from trying to rebuild PYTHON_FOR_GEN stuff
 make -t Python/Python-ast.c \
         Include/Python-ast.h \
@@ -311,10 +335,8 @@
 EXCLUDE="$EXCLUDE test_faulthandler"
 %endif
 # some tests break in QEMU
-%if 0%{?qemu_user_space_build} > 0
-EXCLUDE="$EXCLUDE test_asyncio test_multiprocessing_fork 
test_multiprocessing_forkserver test_multiprocessing_main_handling 
test_multiprocessing_spawn test_threading test_threadedtempfile test_io 
test_posix test_ioctl test_mmap test_openpty test_pty test_time test_subprocess 
test_asyncore test_asyncio test_os test_faulthandler"
-# qemu bug (siginterrupt handling)
-EXCLUDE="$EXCLUDE test_signal"
+%if 0%{?qemu_user_space_build}
+EXCLUDE="$EXCLUDE test_multiprocessing_forkserver test_multiprocessing_spawn 
test_posix test_signal test_socket test_subprocess"
 %endif
 
 # This test (part of test_uuid) requires real network interfaces
@@ -322,10 +344,8 @@
 # done have any such interface breaking the uuid module.
 EXCLUDE="$EXCLUDE test_uuid"
 
-# # https://bugs.python.org/issue34022
-# # There seems to be troubles with the following tests when reproducible
-# # build (with SOURCE_DATE_EPOCH environmental variable set) is run
-EXCLUDE="$EXCLUDE test_cmd_line_script test_multiprocessing_main_handling 
test_runpy"
+# TEMPORARILY EXCLUDE test_capi bpo#37169
+EXCLUDE="$EXCLUDE test_capi"
 
 # Limit virtual memory to avoid spurious failures
 if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
@@ -333,7 +353,10 @@
 fi
 
 export PYTHONPATH="$(pwd -P)/Lib" 
-make -j1 test TESTOPTS="-u curses -v -x $EXCLUDE"
+# Use timeout, like make target buildbottest
+# We cannot run tests parallel, because osc build environment doesn’t
+# have /dev/shm
+make -j1 test TESTOPTS="-u curses -v -x $EXCLUDE --timeout=1200"
 # use network, be verbose:
 #make test TESTOPTS="-l -u network -v"
 
@@ -342,7 +365,7 @@
 
 # clean out stuff that is in python-base and subpackages
 
-rm %{buildroot}%{_bindir}/*
+find %{buildroot}%{_bindir} -mindepth 1 -not -name "*idle3*" -print -delete
 rm %{buildroot}%{_libdir}/lib*
 rm -r %{buildroot}%{_libdir}/pkgconfig
 rm -r %{buildroot}%{_mandir}/*
@@ -358,7 +381,7 @@
     asyncio ctypes collections concurrent distutils email encodings \
     ensurepip html http \
     importlib json logging multiprocessing pydoc_data unittest \
-    urllib venv wsgiref lib2to3 test idlelib turtledemo \
+    urllib venv wsgiref lib2to3 test turtledemo \
     xml xmlrpc
 do
     rm -r %{buildroot}%{sitedir}/$module
@@ -368,15 +391,40 @@
     array _asyncio audioop binascii _bisect _bz2 cmath _codecs_* \
     _contextvars _crypt _csv _ctypes _datetime _decimal fcntl grp \
     _hashlib _heapq _json _lsprof _lzma math mmap _multibytecodec \
-    _multiprocessing _opcode ossaudiodev parser _pickle _posixsubprocess \
-    _queue _random resource select _ssl _socket spwd _struct syslog termios \
-    _testbuffer _testimportmultiple _testmultiphase unicodedata zlib \
-    _ctypes_test _testcapi xxlimited _xxtestfuzz _elementtree pyexpat \
-    _md5 _sha1 _sha256 _sha512 _blake2 _sha3
+    _multiprocessing _opcode ossaudiodev parser _pickle _posixshmem \
+    _posixsubprocess _queue _random resource select _ssl _socket spwd \
+    _statistics _struct syslog termios _testbuffer _testimportmultiple \
+    _testmultiphase unicodedata zlib _ctypes_test _testinternalcapi _testcapi 
xxlimited \
+    _xxtestfuzz _xxsubinterpreters _elementtree pyexpat _md5 _sha1 \
+    _sha256 _sha512 _blake2 _sha3
 do
     eval rm "%{buildroot}%{sitedir}/lib-dynload/$library.*"
 done
 
+# Idle is not packaged in base due to the appstream-glib dependency
+# move idle config into /etc
+install -d -m 755 %{buildroot}%{_sysconfdir}/idle3
+(
+    cd %{buildroot}/%{sitedir}/idlelib/
+    for file in *.def ; do
+        mv $file %{buildroot}%{_sysconfdir}/idle3/
+        ln -sf %{_sysconfdir}/idle3/$file  %{buildroot}/%{sitedir}/idlelib/
+    done
+)
+
+# install idle icons
+for size in 16 32 48 ; do
+    install -m 644 -D Lib/idlelib/Icons/idle_${size}.png \
+    %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/idle3.png
+done
+
+# install idle desktop file
+install -m 644 -D -t %{buildroot}%{_datadir}/applications %{SOURCE20}
+%suse_update_desktop_file idle3
+
+install -m 644 -D -t %{buildroot}%{_datadir}/metainfo %{SOURCE21}
+appstream-util validate-relax --nonet 
%{buildroot}%{_datadir}/metainfo/idle3.appdata.xml
+
 %fdupes %{buildroot}/%{_libdir}/python%{python_version}
 
 %files tk
@@ -407,4 +455,25 @@
 %{dynlib _sqlite3}
 %{dynlib nis}
 
+%files idle
+%defattr(644, root, root, 755)
+%{sitedir}/idlelib
+%dir %{_sysconfdir}/idle3
+%config %{_sysconfdir}/idle3/*
+%doc Lib/idlelib/NEWS.txt
+%doc Lib/idlelib/README.txt
+%doc Lib/idlelib/TODO.txt
+%doc Lib/idlelib/extend.txt
+%doc Lib/idlelib/ChangeLog
+%{_bindir}/idle3
+%{_datadir}/applications/idle3.desktop
+%{_datadir}/metainfo/idle3.appdata.xml
+%{_datadir}/icons/hicolor/*/apps/idle3.png
+%dir %{_datadir}/icons/hicolor
+%dir %{_datadir}/icons/hicolor/16x16
+%dir %{_datadir}/icons/hicolor/32x32
+%dir %{_datadir}/icons/hicolor/48x48
+%dir %{_datadir}/icons/hicolor/*/apps
+%attr(755, root, root) %{_bindir}/idle%{python_version}
+
 %changelog

++++++ CVE-2019-5010-null-defer-x509-cert-DOS.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.484022694 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.488022696 +0100
@@ -23,7 +23,7 @@
 
 --- a/Lib/test/test_ssl.py
 +++ b/Lib/test/test_ssl.py
-@@ -400,6 +400,27 @@ class BasicSocketTests(unittest.TestCase
+@@ -467,6 +467,27 @@ class BasicSocketTests(unittest.TestCase
              }
          )
  
@@ -51,3 +51,9 @@
      def test_parse_cert_CVE_2013_4238(self):
          p = ssl._ssl._test_decode_cert(NULLBYTECERT)
          if support.verbose:
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst
+@@ -0,0 +1,3 @@
++[CVE-2019-5010] Fix a NULL pointer deref in ssl module. The cert parser did
++not handle CRL distribution points with empty DP or URI correctly. A
++malicious or buggy certificate can result into segfault.

++++++ CVE-2020-8492-urllib-ReDoS.patch ++++++
>From 34e25a97709a05f7c804036dd1e16afda6bdfa33 Mon Sep 17 00:00:00 2001
From: Victor Stinner <[email protected]>
Date: Thu, 30 Jan 2020 16:13:03 +0100
Subject: [PATCH 1/2] bpo-39503: Fix urllib basic auth regex

The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking.

Vulnerability reported by Matt Schwager.
---
 Lib/urllib2.py                                                     |    2 +-
 Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 
Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst

--- /dev/null
+++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst
@@ -0,0 +1,4 @@
+CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of 
the
+:mod:`urllib.request` module uses an inefficient regular expression which can
+be exploited by an attacker to cause a denial of service. Fix the regex to
+prevent the catastrophic backtracking. Vulnerability reported by Matt Schwager.
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -945,7 +945,7 @@ class AbstractBasicAuthHandler:
 
     # allow for double- and single-quoted realm values
     # (single quotes are a violation of the RFC, but appear in the wild)
-    rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+'
+    rx = re.compile('(?:[^,]*,)*[ \t]*([^ \t]+)[ \t]+'
                     'realm=(["\']?)([^"\']*)\\2', re.I)
 
     # XXX could pre-emptively send auth info already accepted (RFC 2617,
++++++ F00102-lib64.patch ++++++
>From 81904771db8b112c8617a111e989b68e55af7a9c Mon Sep 17 00:00:00 2001
From: David Malcolm <[email protected]>
Date: Wed, 13 Jan 2010 21:25:18 +0000
Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/
 instead or /usr/lib/
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

Co-authored-by: David Malcolm <[email protected]>
Co-authored-by: Thomas Spura <[email protected]>
Co-authored-by: Slavek Kabrda <[email protected]>
Co-authored-by: Matej Stuchlik <[email protected]>
Co-authored-by: Tomas Orsava <[email protected]>
Co-authored-by: Charalampos Stratakis <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
Co-authored-by: Iryna Shcherbina <[email protected]>
---
 Lib/distutils/command/install.py    |  4 ++--
 Lib/distutils/sysconfig.py          |  6 +++++-
 Lib/distutils/tests/test_install.py |  3 ++-
 Lib/site.py                         |  4 ++++
 Lib/sysconfig.py                    | 12 ++++++------
 Lib/test/test_site.py               |  4 ++--
 Makefile.pre.in                     |  2 +-
 Modules/getpath.c                   |  6 +++---
 configure                           |  4 ++--
 configure.ac                        |  4 ++--
 setup.py                            |  6 +++---
 11 files changed, 32 insertions(+), 23 deletions(-)

--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
 INSTALL_SCHEMES = {
     'unix_prefix': {
         'purelib': '$base/lib/python$py_version_short/site-packages',
-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
+        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
         'scripts': '$base/bin',
         'data'   : '$base',
         },
     'unix_home': {
         'purelib': '$base/lib/python',
-        'platlib': '$base/lib/python',
+        'platlib': '$base/lib64/python',
         'headers': '$base/include/python/$dist_name',
         'scripts': '$base/bin',
         'data'   : '$base',
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, stan
             prefix = plat_specific and EXEC_PREFIX or PREFIX
 
     if os.name == "posix":
+        if plat_specific or standard_lib:
+            lib = "lib64"
+        else:
+            lib = "lib"
         libpython = os.path.join(prefix,
-                                 "lib", "python" + get_python_version())
+                                 lib, "python" + get_python_version())
         if standard_lib:
             return libpython
         else:
--- a/Lib/distutils/tests/test_install.py
+++ b/Lib/distutils/tests/test_install.py
@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirMan
             self.assertEqual(got, expected)
 
         libdir = os.path.join(destination, "lib", "python")
+        platlibdir = os.path.join(destination, "lib", "python")
         check_path(cmd.install_lib, libdir)
-        check_path(cmd.install_platlib, libdir)
+        check_path(cmd.install_platlib, platlibdir)
         check_path(cmd.install_purelib, libdir)
         check_path(cmd.install_headers,
                    os.path.join(destination, "include", "python", "foopkg"))
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -335,11 +335,15 @@ def getsitepackages(prefixes=None):
         seen.add(prefix)
 
         if os.sep == '/':
+            sitepackages.append(os.path.join(prefix, "lib64",
+                                        "python" + sys.version[:3],
+                                        "site-packages"))
             sitepackages.append(os.path.join(prefix, "lib",
                                         "python%d.%d" % sys.version_info[:2],
                                         "site-packages"))
         else:
             sitepackages.append(prefix)
+            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
     return sitepackages
 
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -20,10 +20,10 @@ __all__ = [
 
 _INSTALL_SCHEMES = {
     'posix_prefix': {
-        'stdlib': '{installed_base}/lib/python{py_version_short}',
-        'platstdlib': '{platbase}/lib/python{py_version_short}',
+        'stdlib': '{installed_base}/lib64/python{py_version_short}',
+        'platstdlib': '{platbase}/lib64/python{py_version_short}',
         'purelib': '{base}/lib/python{py_version_short}/site-packages',
-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
+        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
         'include':
             '{installed_base}/include/python{py_version_short}{abiflags}',
         'platinclude':
@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = {
         'data': '{userbase}',
         },
     'posix_user': {
-        'stdlib': '{userbase}/lib/python{py_version_short}',
-        'platstdlib': '{userbase}/lib/python{py_version_short}',
+        'stdlib': '{userbase}/lib64/python{py_version_short}',
+        'platstdlib': '{userbase}/lib64/python{py_version_short}',
         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
+        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
         'include': '{userbase}/include/python{py_version_short}',
         'scripts': '{userbase}/bin',
         'data': '{userbase}',
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -266,8 +266,8 @@ class HelperFunctionsTests(unittest.Test
         dirs = site.getsitepackages()
         if os.sep == '/':
             # OS X, Linux, FreeBSD, etc
-            self.assertEqual(len(dirs), 1)
-            wanted = os.path.join('xoxo', 'lib',
+            self.assertEqual(len(dirs), 2)
+            wanted = os.path.join('xoxo', 'lib64',
                                   'python%d.%d' % sys.version_info[:2],
                                   'site-packages')
             self.assertEqual(dirs[0], wanted)
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -143,7 +143,7 @@ LIBDIR=             @libdir@
 MANDIR=                @mandir@
 INCLUDEDIR=    @includedir@
 CONFINCLUDEDIR=        $(exec_prefix)/include
-SCRIPTDIR=     $(prefix)/lib
+SCRIPTDIR=     $(prefix)/lib64
 ABIFLAGS=      @ABIFLAGS@
 
 # Detailed destination directories
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *c
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) 
< 0) {
             return PATHLEN_ERR();
         }
-        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
+        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
         if (_PyStatus_EXCEPTION(status)) {
             return status;
         }
@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calc
             return PATHLEN_ERR();
         }
     }
-    status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
+    status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
     if (_PyStatus_EXCEPTION(status)) {
         return status;
     }
@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculat
     if (!calculate->exec_prefix) {
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
     }
-    calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len);
+    calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len);
     if (!calculate->lib_python) {
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
     }
--- a/configure
+++ b/configure
@@ -15188,9 +15188,9 @@ fi
 
 
 if test x$PLATFORM_TRIPLET = x; then
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
 else
-  
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+  
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
 fi
 
 
--- a/configure.ac
+++ b/configure.ac
@@ -4674,9 +4674,9 @@ fi
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
 AC_SUBST(PY_ENABLE_SHARED)
 if test x$PLATFORM_TRIPLET = x; then
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
 else
-  
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+  
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
 fi
 AC_SUBST(LIBPL)
 
--- a/setup.py
+++ b/setup.py
@@ -649,7 +649,7 @@ class PyBuildExt(build_ext):
         # directories (i.e. '.' and 'Include') must be first.  See issue
         # 10520.
         if not CROSS_COMPILING:
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
         # only change this for cross builds for 3.3, issues on Mageia
         if CROSS_COMPILING:
@@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
             elif curses_library:
                 readline_libs.append(curses_library)
             elif self.compiler.find_library_file(self.lib_dirs +
-                                                     ['/usr/lib/termcap'],
+                                                     ['/usr/lib64/termcap'],
                                                      'termcap'):
                 readline_libs.append('termcap')
             self.add(Extension('readline', ['readline.c'],
-                               library_dirs=['/usr/lib/termcap'],
+                               library_dirs=['/usr/lib64/termcap'],
                                extra_link_args=readline_extra_link_args,
                                libraries=readline_libs))
         else:
++++++ F00251-change-user-install-location.patch ++++++
>From 910f38d9768d39d4d31426743ae4081ed1ab66b6 Mon Sep 17 00:00:00 2001
From: Michal Cyprian <[email protected]>
Date: Mon, 26 Jun 2017 16:32:56 +0200
Subject: [PATCH] 00251: Change user install location

Set values of prefix and exec_prefix in distutils install command
to /usr/local if executable is /usr/bin/python* and RPM build
is not detected to make pip and distutils install into separate location.

Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
---
 Lib/distutils/command/install.py | 15 +++++++++++++--
 Lib/site.py                      |  9 ++++++++-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index ae4f915669..0e4fd5b74a 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -418,8 +418,19 @@ class install(Command):
                     raise DistutilsOptionError(
                           "must not supply exec-prefix without prefix")
 
-                self.prefix = os.path.normpath(sys.prefix)
-                self.exec_prefix = os.path.normpath(sys.exec_prefix)
+                # self.prefix is set to sys.prefix + /local/
+                # if neither RPM build nor virtual environment is
+                # detected to make pip and distutils install packages
+                # into the separate location.
+                if (not (hasattr(sys, 'real_prefix') or
+                    sys.prefix != sys.base_prefix) and
+                    'RPM_BUILD_ROOT' not in os.environ):
+                    addition = "/local"
+                else:
+                    addition = ""
+
+                self.prefix = os.path.normpath(sys.prefix) + addition
+                self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition
 
             else:
                 if self.exec_prefix is None:
diff --git a/Lib/site.py b/Lib/site.py
index 22d53fa562..9513526109 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -348,7 +348,14 @@ def getsitepackages(prefixes=None):
     return sitepackages
 
 def addsitepackages(known_paths, prefixes=None):
-    """Add site-packages to sys.path"""
+    """Add site-packages to sys.path
+
+    '/usr/local' is included in PREFIXES if RPM build is not detected
+    to make packages installed into this location visible.
+
+    """
+    if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ:
+        PREFIXES.insert(0, "/usr/local")
     for sitedir in getsitepackages(prefixes):
         if os.path.isdir(sitedir):
             addsitedir(sitedir, known_paths)
-- 
2.21.0

++++++ OBS_dev-shm.patch ++++++
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -13,6 +13,7 @@ try:
     import ssl
 except ImportError:
     ssl = None
+import stat
 import subprocess
 import sys
 import threading
@@ -2633,7 +2634,8 @@ class GetEventLoopTestsMixin:
             asyncio.get_event_loop = self.get_event_loop_saved
 
     if sys.platform != 'win32':
-
+        @unittest.skipUnless(os.path.exists("/dev/shm") and 
stat.S_IMODE(os.stat('/dev/shm').st_mode) >= 0o777,
+                             "Doesn't work without /dev/shm.")
         def test_get_event_loop_new_process(self):
             # Issue bpo-32126: The multiprocessing module used by
             # ProcessPoolExecutor is not functional when the
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-10-05-15-50-24.bpo-38377.gKfVDt.rst
@@ -0,0 +1,2 @@
+Skip test_get_event_loop_new_process on systems which don’t provide it
+(e.g., building environments of some Linux distributions).
++++++ Python-3.7.3.tar.xz -> Python-3.8.2.tar.xz ++++++
/work/SRC/openSUSE:Factory/python3/Python-3.7.3.tar.xz 
/work/SRC/openSUSE:Factory/.python3.new.26092/Python-3.8.2.tar.xz differ: char 
25, line 1

++++++ SUSE-FEDORA-multilib.patch ++++++
--- a/configure.ac
+++ b/configure.ac
@@ -4671,12 +4671,26 @@ else
   LIBPYTHON=''
 fi
 
+# platsubdir must be defined before LIBPL definition
+AC_MSG_CHECKING(for custom platsubdir)
+AC_ARG_WITH(custom-platsubdir,
+    [AS_HELP_STRING([--with-custom-platsubdir=<libdirname>],
+        [set the platsubdir name to a custom string])],
+    [],
+    [with_custom_platsubdir=yes])
+AS_CASE($with_custom_platsubdir,
+    [yes],[platsubdir=`basename ${libdir}`],
+    [no],[platsubdir=lib],
+    [platsubdir=$with_custom_platsubdir])
+AC_MSG_RESULT($platsubdir)
+AC_SUBST(platsubdir)
+
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
 AC_SUBST(PY_ENABLE_SHARED)
 if test x$PLATFORM_TRIPLET = x; then
-  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
+  LIBPL='$(prefix)'"/${platsubdir}/python${VERSION}/config-${LDVERSION}"
 else
-  
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+  
LIBPL='$(prefix)'"/${platsubdir}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
 fi
 AC_SUBST(LIBPL)
 
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -137,13 +137,16 @@ exec_prefix=      @exec_prefix@
 # Install prefix for data files
 datarootdir=    @datarootdir@
 
+# Name of "lib" directory under prefix
+platsubdir=    @platsubdir@
+
 # Expanded directories
 BINDIR=                @bindir@
 LIBDIR=                @libdir@
 MANDIR=                @mandir@
 INCLUDEDIR=    @includedir@
 CONFINCLUDEDIR=        $(exec_prefix)/include
-SCRIPTDIR=     $(prefix)/lib64
+SCRIPTDIR=     @libdir@
 ABIFLAGS=      @ABIFLAGS@
 
 # Detailed destination directories
@@ -754,6 +757,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
                -DEXEC_PREFIX='"$(exec_prefix)"' \
                -DVERSION='"$(VERSION)"' \
                -DVPATH='"$(VPATH)"' \
+               -DPLATLIBDIR='"$(platsubdir)"' \
                -o $@ $(srcdir)/Modules/getpath.c
 
 Programs/python.o: $(srcdir)/Programs/python.c
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -55,12 +55,12 @@
  * pybuilddir.txt.  If the landmark is found, we're done.
  *
  * For the remaining steps, the prefix landmark will always be
- * lib/python$VERSION/os.py and the exec_prefix will always be
- * lib/python$VERSION/lib-dynload, where $VERSION is Python's version
- * number as supplied by the Makefile.  Note that this means that no more
- * build directory checking is performed; if the first step did not find
- * the landmarks, the assumption is that python is running from an
- * installed setup.
+ * $lib/python$VERSION/os.py and the exec_prefix will always be
+ * $lib/python$VERSION/lib-dynload, where $VERSION is Python's version
+ * number and $lib is PLATLIBDIR as supplied by the Makefile.  Note that
+ * this means that no more build directory checking is performed; if the
+ * first step did not find the landmarks, the assumption is that python
+ * is running from an installed setup.
  *
  * Step 2. See if the $PYTHONHOME environment variable points to the
  * installed location of the Python libraries.  If $PYTHONHOME is set, then
@@ -86,7 +86,7 @@
  * containing the shared library modules is appended.  The environment
  * variable $PYTHONPATH is inserted in front of it all.  Finally, the
  * prefix and exec_prefix globals are tweaked so they reflect the values
- * expected by other code, by stripping the "lib/python$VERSION/..." stuff
+ * expected by other code, by stripping the "$lib/python$VERSION/..." stuff
  * off.  If either points to the build directory, the globals are reset to
  * the corresponding preprocessor variables (so sys.prefix will reflect the
  * installation location, even though sys.path points into the build
@@ -105,8 +105,8 @@ extern "C" {
 #endif
 
 
-#if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || 
!defined(VPATH)
-#error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+#if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || 
!defined(VPATH) || !defined(PLATLIBDIR)
+#error "PREFIX, EXEC_PREFIX, VERSION, VPATH, and PLATLIBDIR must be constant 
defined"
 #endif
 
 #ifndef LANDMARK
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *c
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) 
< 0) {
             return PATHLEN_ERR();
         }
-        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
+        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
         if (_PyStatus_EXCEPTION(status)) {
             return status;
         }
@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calc
             return PATHLEN_ERR();
         }
     }
-    status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
+    status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
     if (_PyStatus_EXCEPTION(status)) {
         return status;
     }
@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculat
     if (!calculate->exec_prefix) {
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
     }
-    calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len);
+    calculate->lib_python = Py_DecodeLocale(PLATLIBDIR "/python" VERSION, 
&len);
     if (!calculate->lib_python) {
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
     }
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
 INSTALL_SCHEMES = {
     'unix_prefix': {
         'purelib': '$base/lib/python$py_version_short/site-packages',
-        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
+        'platlib': 
'$platbase/$platsubdir/python$py_version_short/site-packages',
         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
         'scripts': '$base/bin',
         'data'   : '$base',
         },
     'unix_home': {
         'purelib': '$base/lib/python',
-        'platlib': '$base/lib64/python',
+        'platlib': '$base/lib/python',
         'headers': '$base/include/python/$dist_name',
         'scripts': '$base/bin',
         'data'   : '$base',
@@ -281,7 +281,7 @@ class install(Command):
         # about needing recursive variable expansion (shudder).
 
         py_version = sys.version.split()[0]
-        (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
+        (prefix, exec_prefix, platsubdir) = get_config_vars('prefix', 
'exec_prefix', 'platsubdir')
         try:
             abiflags = sys.abiflags
         except AttributeError:
@@ -298,6 +298,7 @@ class install(Command):
                             'sys_exec_prefix': exec_prefix,
                             'exec_prefix': exec_prefix,
                             'abiflags': abiflags,
+                            'platsubdir': platsubdir,
                            }
 
         if HAS_USER_SITE:
@@ -419,12 +420,11 @@ class install(Command):
                           "must not supply exec-prefix without prefix")
 
                 # self.prefix is set to sys.prefix + /local/
-                # if neither RPM build nor virtual environment is
-                # detected to make pip and distutils install packages
-                # into the separate location.
-                if (not (hasattr(sys, 'real_prefix') or
-                    sys.prefix != sys.base_prefix) and
-                    'RPM_BUILD_ROOT' not in os.environ):
+                # if the executable is /usr/bin/python* and RPM build
+                # is not detected to make pip and distutils install into
+                # the separate location.
+                if (sys.executable.startswith("/usr/bin/python")
+                    and 'RPM_BUILD_ROOT' not in os.environ):
                     addition = "/local"
                 else:
                     addition = ""
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -146,12 +146,9 @@ def get_python_lib(plat_specific=0, stan
             prefix = plat_specific and EXEC_PREFIX or PREFIX
 
     if os.name == "posix":
-        if plat_specific or standard_lib:
-            lib = "lib64"
-        else:
-            lib = "lib"
+        libdir = plat_specific and get_config_var("platsubdir") or "lib"
         libpython = os.path.join(prefix,
-                                 lib, "python" + get_python_version())
+                                 libdir, "python" + get_python_version())
         if standard_lib:
             return libpython
         else:
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -20,10 +20,10 @@ __all__ = [
 
 _INSTALL_SCHEMES = {
     'posix_prefix': {
-        'stdlib': '{installed_base}/lib64/python{py_version_short}',
-        'platstdlib': '{platbase}/lib64/python{py_version_short}',
+        'stdlib': '{installed_base}/{platsubdir}/python{py_version_short}',
+        'platstdlib': '{platbase}/{platsubdir}/python{py_version_short}',
         'purelib': '{base}/lib/python{py_version_short}/site-packages',
-        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
+        'platlib': 
'{platbase}/{platsubdir}/python{py_version_short}/site-packages',
         'include':
             '{installed_base}/include/python{py_version_short}{abiflags}',
         'platinclude':
@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = {
         'data': '{userbase}',
         },
     'posix_user': {
-        'stdlib': '{userbase}/lib64/python{py_version_short}',
-        'platstdlib': '{userbase}/lib64/python{py_version_short}',
+        'stdlib': '{userbase}/lib/python{py_version_short}',
+        'platstdlib': '{userbase}/lib/python{py_version_short}',
         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
-        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
+        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
         'include': '{userbase}/include/python{py_version_short}',
         'scripts': '{userbase}/bin',
         'data': '{userbase}',
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -335,12 +335,18 @@ def getsitepackages(prefixes=None):
         seen.add(prefix)
 
         if os.sep == '/':
-            sitepackages.append(os.path.join(prefix, "lib64",
+            from sysconfig import get_config_var
+            platsubdir = get_config_var("platsubdir")
+            sitepackages.append(os.path.join(prefix, platsubdir,
                                         "python" + sys.version[:3],
                                         "site-packages"))
-            sitepackages.append(os.path.join(prefix, "lib",
+            sitepackages.append(os.path.join(prefix, platsubdir,
                                         "python%d.%d" % sys.version_info[:2],
                                         "site-packages"))
+            if platsubdir != "lib":
+                sitepackages.append(os.path.join(prefix, "lib",
+                                            "python%d.%d" % 
sys.version_info[:2],
+                                            "site-packages"))
         else:
             sitepackages.append(prefix)
             sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
@@ -348,14 +354,7 @@ def getsitepackages(prefixes=None):
     return sitepackages
 
 def addsitepackages(known_paths, prefixes=None):
-    """Add site-packages to sys.path
-
-    '/usr/local' is included in PREFIXES if RPM build is not detected
-    to make packages installed into this location visible.
-
-    """
-    if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ:
-        PREFIXES.insert(0, "/usr/local")
+    """Add site-packages to sys.path"""
     for sitedir in getsitepackages(prefixes):
         if os.path.isdir(sitedir):
             addsitedir(sitedir, known_paths)
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -266,8 +266,11 @@ class HelperFunctionsTests(unittest.Test
         dirs = site.getsitepackages()
         if os.sep == '/':
             # OS X, Linux, FreeBSD, etc
-            self.assertEqual(len(dirs), 2)
-            wanted = os.path.join('xoxo', 'lib64',
+            self.assertTrue(len(dirs) in (1,2,3),
+                            "dirs = {} has len not in (1,2,3).".format(dirs))
+
+            platsubdir = sysconfig.get_config_var('platsubdir')
+            wanted = os.path.join('xoxo', platsubdir,
                                   'python%d.%d' % sys.version_info[:2],
                                   'site-packages')
             self.assertEqual(dirs[0], wanted)
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -243,6 +243,7 @@ class TestSysConfig(unittest.TestCase):
         # is similar to the global posix_prefix one
         base = get_config_var('base')
         user = get_config_var('userbase')
+        platsubdir = get_config_var("platsubdir")
         # the global scheme mirrors the distinction between prefix and
         # exec-prefix but not the user scheme, so we have to adapt the paths
         # before comparing (issue #9100)
@@ -257,8 +258,19 @@ class TestSysConfig(unittest.TestCase):
                 # before comparing
                 global_path = global_path.replace(sys.base_prefix, sys.prefix)
                 base = base.replace(sys.base_prefix, sys.prefix)
+
+            if platsubdir != "lib":
+                platbase = os.path.join(base, platsubdir)
+                purebase = os.path.join(base, "lib")
+                userlib = os.path.join(user, "lib")
+                # replace platbase first because usually purebase is a prefix 
of platbase
+                # /usr/lib is prefix of /usr/lib64 and would get replaced first
+                modified_path = global_path.replace(platbase, userlib, 
1).replace(purebase, userlib, 1)
+            else:
+                modified_path = global_path.replace(base, user, 1)
+
             user_path = get_path(name, 'posix_user')
-            self.assertEqual(user_path, global_path.replace(base, user, 1))
+            self.assertEqual(user_path, modified_path)
 
     def test_main(self):
         # just making sure _main() runs and returns things in the stdout
--- a/configure
+++ b/configure
@@ -15188,9 +15188,9 @@ fi
 
 
 if test x$PLATFORM_TRIPLET = x; then
-  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
+  LIBPL='$(prefix)'"/${platsubdir}/python${VERSION}/config-${LDVERSION}"
 else
-  
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+  
LIBPL='$(prefix)'"/${platsubdir}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
 fi
 
 
--- a/setup.py
+++ b/setup.py
@@ -649,7 +649,7 @@ class PyBuildExt(build_ext):
         # directories (i.e. '.' and 'Include') must be first.  See issue
         # 10520.
         if not CROSS_COMPILING:
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
         # only change this for cross builds for 3.3, issues on Mageia
         if CROSS_COMPILING:
@@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
             elif curses_library:
                 readline_libs.append(curses_library)
             elif self.compiler.find_library_file(self.lib_dirs +
-                                                     ['/usr/lib64/termcap'],
+                                                     ['/usr/lib/termcap'],
                                                      'termcap'):
                 readline_libs.append('termcap')
             self.add(Extension('readline', ['readline.c'],
-                               library_dirs=['/usr/lib64/termcap'],
+                               library_dirs=['/usr/lib/termcap'],
                                extra_link_args=readline_extra_link_args,
                                libraries=readline_libs))
         else:
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -10,6 +10,7 @@ import re
 import shutil
 import subprocess
 import sys
+import sysconfig
 import tempfile
 import textwrap
 
@@ -1070,12 +1071,13 @@ class InitConfigTests(EmbeddingTestsMixi
             return config['config']['module_search_paths']
         else:
             ver = sys.version_info
+            platsubdir = sysconfig.get_config_var('platsubdir')
             return [
                 os.path.join(prefix, 'lib',
                              f'python{ver.major}{ver.minor}.zip'),
-                os.path.join(prefix, 'lib',
+                os.path.join(prefix, platsubdir,
                              f'python{ver.major}.{ver.minor}'),
-                os.path.join(exec_prefix, 'lib',
+                os.path.join(exec_prefix, platsubdir,
                              f'python{ver.major}.{ver.minor}', 'lib-dynload'),
             ]
 
@@ -1180,13 +1182,15 @@ class InitConfigTests(EmbeddingTestsMixi
     def test_init_pyvenv_cfg(self):
         # Test path configuration with pyvenv.cfg configuration file
 
+        platsubdir = sysconfig.get_config_var('platsubdir')
+
         with self.tmpdir_with_python() as tmpdir, \
              tempfile.TemporaryDirectory() as pyvenv_home:
             ver = sys.version_info
 
             if not MS_WINDOWS:
                 lib_dynload = os.path.join(pyvenv_home,
-                                           'lib',
+                                           platsubdir,
                                            f'python{ver.major}.{ver.minor}',
                                            'lib-dynload')
                 os.makedirs(lib_dynload)
++++++ baselibs.conf ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.596022763 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.600022765 +0100
@@ -1,3 +1,3 @@
 python3
 python3-base
-libpython3_7m1_0
+libpython3_8-1_0

++++++ bpo-31046_ensurepip_honours_prefix.patch ++++++
>From 5754521af1d51aa8e445cba07a093bbc0c88596d Mon Sep 17 00:00:00 2001
From: Zackery Spytz <[email protected]>
Date: Mon, 16 Dec 2019 18:24:08 -0700
Subject: [PATCH] bpo-31046: ensurepip does not honour the value of $(prefix)

Co-Authored-By: Xavier de Gaye <[email protected]>
---
 Doc/library/ensurepip.rst                      |  9 +++++++--
 Lib/ensurepip/__init__.py                      | 18 +++++++++++++-----
 Lib/test/test_ensurepip.py                     | 11 +++++++++++
 Makefile.pre.in                                |  4 ++--
 .../2019-12-16-17-50-42.bpo-31046.XA-Qfr.rst   |  1 +
 5 files changed, 34 insertions(+), 9 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Build/2019-12-16-17-50-42.bpo-31046.XA-Qfr.rst

--- a/Doc/library/ensurepip.rst
+++ b/Doc/library/ensurepip.rst
@@ -56,8 +56,9 @@ is at least as recent as the one bundled
 By default, ``pip`` is installed into the current virtual environment
 (if one is active) or into the system site packages (if there is no
 active virtual environment). The installation location can be controlled
-through two additional command line options:
+through some additional command line options:
 
+* ``--prefix <dir>``: Installs ``pip`` using the given directory prefix.
 * ``--root <dir>``: Installs ``pip`` relative to the given root directory
   rather than the root of the currently active virtual environment (if any)
   or the default root for the current Python installation.
@@ -89,7 +90,7 @@ Module API
    Returns a string specifying the bundled version of pip that will be
    installed when bootstrapping an environment.
 
-.. function:: bootstrap(root=None, upgrade=False, user=False, \
+.. function:: bootstrap(root=None, prefix=None, upgrade=False, user=False, \
                         altinstall=False, default_pip=False, \
                         verbosity=0)
 
@@ -99,6 +100,8 @@ Module API
    If *root* is ``None``, then installation uses the default install location
    for the current environment.
 
+   *prefix* specifies the directory prefix to use when installing.
+
    *upgrade* indicates whether or not to upgrade an existing installation
    of an earlier version of ``pip`` to the bundled version.
 
@@ -119,6 +122,8 @@ Module API
    *verbosity* controls the level of output to :data:`sys.stdout` from the
    bootstrapping operation.
 
+   .. versionchanged:: 3.9 the *prefix* parameter was added.
+
    .. audit-event:: ensurepip.bootstrap root ensurepip.bootstrap
 
    .. note::
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -46,27 +46,27 @@ def _disable_pip_configuration_settings(
     os.environ['PIP_CONFIG_FILE'] = os.devnull
 
 
-def bootstrap(*, root=None, upgrade=False, user=False,
+def bootstrap(*, root=None, prefix=None, upgrade=False, user=False,
               altinstall=False, default_pip=False,
               verbosity=0):
     """
     Bootstrap pip into the current Python installation (or the given root
-    directory).
+    and directory prefix).
 
     Note that calling this function will alter both sys.path and os.environ.
     """
     # Discard the return value
-    _bootstrap(root=root, upgrade=upgrade, user=user,
+    _bootstrap(root=root, prefix=prefix, upgrade=upgrade, user=user,
                altinstall=altinstall, default_pip=default_pip,
                verbosity=verbosity)
 
 
-def _bootstrap(*, root=None, upgrade=False, user=False,
+def _bootstrap(*, root=None, prefix=None, upgrade=False, user=False,
               altinstall=False, default_pip=False,
               verbosity=0):
     """
     Bootstrap pip into the current Python installation (or the given root
-    directory). Returns pip command status code.
+    and directory prefix). Returns pip command status code.
 
     Note that calling this function will alter both sys.path and os.environ.
     """
@@ -109,6 +109,8 @@ def _bootstrap(*, root=None, upgrade=Fal
         args = ["install", "--no-index", "--find-links", tmpdir]
         if root:
             args += ["--root", root]
+        if prefix:
+            args += ["--prefix", prefix]
         if upgrade:
             args += ["--upgrade"]
         if user:
@@ -181,6 +183,11 @@ def _main(argv=None):
         help="Install everything relative to this alternate root directory.",
     )
     parser.add_argument(
+        "--prefix",
+        default=None,
+        help="Install everything using this prefix.",
+    )
+    parser.add_argument(
         "--altinstall",
         action="store_true",
         default=False,
@@ -199,6 +206,7 @@ def _main(argv=None):
 
     return _bootstrap(
         root=args.root,
+        prefix=args.prefix,
         upgrade=args.upgrade,
         user=args.user,
         verbosity=args.verbosity,
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -61,6 +61,17 @@ class TestBootstrap(EnsurepipMixin, unit
             unittest.mock.ANY,
         )
 
+    def test_bootstrapping_with_prefix(self):
+        ensurepip.bootstrap(prefix="/foo/bar/")
+        self.run_pip.assert_called_once_with(
+            [
+                "install", "--no-index", "--find-links",
+                unittest.mock.ANY, "--prefix", "/foo/bar/",
+                "setuptools", "pip",
+            ],
+            unittest.mock.ANY,
+        )
+
     def test_bootstrapping_with_user(self):
         ensurepip.bootstrap(user=True)
 
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1188,7 +1188,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoni
                        install|*) ensurepip="" ;; \
                esac; \
                $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
-                       $$ensurepip --root=$(DESTDIR)/ ; \
+                       $$ensurepip --root=$(DESTDIR)/ --prefix=$(prefix) ; \
        fi
 
 altinstall: commoninstall
@@ -1198,7 +1198,7 @@ altinstall: commoninstall
                        install|*) ensurepip="--altinstall" ;; \
                esac; \
                $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
-                       $$ensurepip --root=$(DESTDIR)/ ; \
+                       $$ensurepip --root=$(DESTDIR)/ --prefix=$(prefix) ; \
        fi
 
 commoninstall:  check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2019-12-16-17-50-42.bpo-31046.XA-Qfr.rst
@@ -0,0 +1 @@
+A directory prefix can now be specified when using :mod:`ensurepip`.
++++++ bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.616022775 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.616022775 +0100
@@ -34,9 +34,9 @@
 
 --- a/Doc/library/py_compile.rst
 +++ b/Doc/library/py_compile.rst
-@@ -82,6 +82,11 @@ byte-code cache files in the directory c
-       overrides the value of the *invalidation_mode* argument, and determines
-       its default value instead.
+@@ -92,6 +92,11 @@ byte-code cache files in the directory c
+    .. versionchanged:: 3.8
+       The *quiet* parameter was added.
  
 +   .. versionchanged:: 3.7.2
 +      The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer
@@ -48,7 +48,7 @@
  
 --- a/Lib/test/test_compileall.py
 +++ b/Lib/test/test_compileall.py
-@@ -210,6 +210,21 @@ class CompileallTestsWithoutSourceEpoch(
+@@ -209,6 +209,21 @@ class CompileallTestsWithoutSourceEpoch(
      pass
  
  
@@ -70,7 +70,7 @@
  class EncodingTest(unittest.TestCase):
      """Issue 6716: compileall should escape source code when printing errors
      to stdout."""
-@@ -580,6 +595,21 @@ class CommandLineTestsBase:
+@@ -579,6 +594,21 @@ class CommandLineTestsBase:
  
  
  class CommmandLineTestsWithSourceEpoch(CommandLineTestsBase,
@@ -124,7 +124,7 @@
  
 --- a/Lib/test/test_py_compile.py
 +++ b/Lib/test/test_py_compile.py
-@@ -207,5 +207,19 @@ class PyCompileTestsWithoutSourceEpoch(P
+@@ -216,5 +216,19 @@ class PyCompileTestsWithoutSourceEpoch(P
      pass
  
  

++++++ bpo36302-sort-module-sources.patch ++++++
>From ca04974425c84f306ddcebe88d6b31442e34e89d Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <[email protected]>
Date: Mon, 5 Jun 2017 17:33:33 +0200
Subject: [PATCH] bpo-36302: Sort list of sources

when building packages (e.g. for openSUSE Linux)
(random) filesystem order of input files
influences ordering of functions in the output .so files.
Thus without the patch, builds (in disposable VMs) would usually differ.

Without this patch, all callers have to be patched individually
https://github.com/dugsong/libdnet/pull/42
https://github.com/sass/libsass-python/pull/212
https://github.com/tahoe-lafs/pycryptopp/pull/41
https://github.com/yt-project/yt/pull/2206
https://github.com/pyproj4/pyproj/pull/142
https://github.com/pytries/datrie/pull/49
https://github.com/Roche/pyreadstat/pull/37
but that is an infinite effort.

See https://reproducible-builds.org/ for why this matters.
---
 Lib/distutils/command/build_ext.py                             | 3 ++-
 .../next/Library/2019-03-21-19-23-46.bpo-36302.Yc591g.rst      | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 
Misc/NEWS.d/next/Library/2019-03-21-19-23-46.bpo-36302.Yc591g.rst

diff --git a/Lib/distutils/command/build_ext.py 
b/Lib/distutils/command/build_ext.py
index 2d7cdf063f01..38bb8fd93c27 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -490,7 +490,8 @@ def build_extension(self, ext):
                   "in 'ext_modules' option (extension '%s'), "
                   "'sources' must be present and must be "
                   "a list of source filenames" % ext.name)
-        sources = list(sources)
+        # sort to make the resulting .so file build reproducible
+        sources = sorted(sources)
 
         ext_path = self.get_ext_fullpath(ext.name)
         depends = sources + ext.depends
diff --git a/Misc/NEWS.d/next/Library/2019-03-21-19-23-46.bpo-36302.Yc591g.rst 
b/Misc/NEWS.d/next/Library/2019-03-21-19-23-46.bpo-36302.Yc591g.rst
new file mode 100644
index 000000000000..fe01b5915d5d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-03-21-19-23-46.bpo-36302.Yc591g.rst
@@ -0,0 +1,2 @@
+distutils sorts source file lists so that Extension .so files
+build more reproducibly by default
++++++ distutils-reproducible-compile.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.632022785 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.636022787 +0100
@@ -1,6 +1,6 @@
 --- a/Lib/distutils/util.py
 +++ b/Lib/distutils/util.py
-@@ -421,7 +421,7 @@ byte_compile(files, optimize=%r, force=%
+@@ -432,7 +432,7 @@ byte_compile(files, optimize=%r, force=%
      else:
          from py_compile import compile
  

++++++ idle3.appdata.xml ++++++
<?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright 2017 Zbigniew Jędrzejewski-Szmek -->
<application>
  <id type="desktop">idle3.desktop</id>
  <name>IDLE3</name>
  <metadata_licence>CC0</metadata_licence>
  <project_license>Python-2.0</project_license>
  <summary>Python 3 Integrated Development and Learning Environment</summary>
  <description>
    <p>
      IDLE is Python’s Integrated Development and Learning Environment.
      The GUI is uniform between Windows, Unix, and Mac OS X.
      IDLE provides an easy way to start writing, running, and debugging
      Python code.
    </p>
    <p>
      IDLE is written in pure Python, and uses the tkinter GUI toolkit.
      It provides:
    </p>
    <ul>
       <li>a Python shell window (interactive interpreter) with colorizing of 
code input, output, and error messages,</li>
       <li>a multi-window text editor with multiple undo, Python colorizing, 
smart indent, call tips, auto completion, and other features,</li>
       <li>search within any window, replace within editor windows, and search 
through multiple files (grep),</li>
       <li>a debugger with persistent breakpoints, stepping, and viewing of 
global and local namespaces.</li>
    </ul>
  </description>
  <url type="homepage">https://docs.python.org/3/library/idle.html</url>
  <screenshots>
    <screenshot 
type="default">http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-main-window.png</screenshot>
    
<screenshot>http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-class-browser.png</screenshot>
    
<screenshot>http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-code-viewer.png</screenshot>
  </screenshots>
  <update_contact>[email protected]</update_contact>
</application>
++++++ idle3.desktop ++++++
[Desktop Entry]
Version=1.0
Name=IDLE 3
GenericName=Python 3 IDE
Comment=Python 3 Integrated Development and Learning Environment
Exec=idle3 %F
TryExec=idle3
Terminal=false
Type=Application
Icon=idle3
Categories=Development;IDE;
MimeType=text/x-python;
++++++ import_failed.map ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.684022817 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.688022820 +0100
@@ -1,7 +1,7 @@
 python3-tools: turtledemo
-python3-idle: idlelib
-python3-testsuite: test _ctypes_test _testbuffer _testcapi _testimportmultiple 
_testmultiphase xxlimited
+python3-testsuite: test _ctypes_test _testbuffer _testcapi _testinternalcapi 
_testimportmultiple _testmultiphase xxlimited
 python3-tk: tkinter _tkinter
 python3-curses: curses _curses _curses_panel
 python3-dbm: dbm _dbm _gdbm
 python3: sqlite3 readline _sqlite3 nis
+python3-idle: idlelib

++++++ pre_checkin.sh ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.720022839 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.720022839 +0100
@@ -43,7 +43,7 @@
 
 
 # update baselibs
-sed -i -r 's/^libpython.*$/libpython'$python_version_soname'm1_0/' 
baselibs.conf
+sed -i -r 's/^libpython.*$/libpython'$python_version_soname'-1_0/' 
baselibs.conf
 
 
 # copy definition sections

++++++ python-3.3.0b1-fix_date_time_compiler.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.728022844 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.728022844 +0100
@@ -1,7 +1,7 @@
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -761,11 +761,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
-               $(MODOBJS) \
+@@ -746,11 +746,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+               $(DTRACE_OBJS) \
                $(srcdir)/Modules/getbuildinfo.c
        $(CC) -c $(PY_CORE_CFLAGS) \
 +            -DDATE="\"`date -u -r Makefile.pre.in +"%b %d %Y"`\"" \

++++++ python-3.3.0b1-localpath.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.736022849 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.736022849 +0100
@@ -1,9 +1,7 @@
-Index: Lib/site.py
-===================================================================
---- Lib/site.py.orig
-+++ Lib/site.py
-@@ -75,7 +75,7 @@ import builtins
- import _sitebuiltins
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -76,7 +76,7 @@ import _sitebuiltins
+ import io
  
  # Prefixes for site-packages; add additional prefixes like /usr/local here
 -PREFIXES = [sys.prefix, sys.exec_prefix]

++++++ python-3.3.0b1-test-posix_fadvise.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.744022854 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.744022854 +0100
@@ -1,6 +1,6 @@
 --- a/Lib/test/test_posix.py
 +++ b/Lib/test/test_posix.py
-@@ -409,7 +409,7 @@ class PosixTester(unittest.TestCase):
+@@ -421,7 +421,7 @@ class PosixTester(unittest.TestCase):
      def test_posix_fadvise(self):
          fd = os.open(support.TESTFN, os.O_RDONLY)
          try:

++++++ python.keyring ++++++
Binary files /var/tmp/diff_new_pack.nz6JWA/_old and 
/var/tmp/diff_new_pack.nz6JWA/_new differ

++++++ python3-imp-returntype.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.776022873 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.776022873 +0100
@@ -24,7 +24,7 @@
 
 --- a/Lib/test/test_imp.py
 +++ b/Lib/test/test_imp.py
-@@ -365,6 +365,20 @@ class ImportTests(unittest.TestCase):
+@@ -376,6 +376,20 @@ class ImportTests(unittest.TestCase):
              mod = imp.load_module('mymod', file, path, description)
          self.assertEqual(mod.x, 42)
  

++++++ skip_random_failing_tests.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.788022881 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.788022881 +0100
@@ -82,7 +82,7 @@
 
 --- a/Lib/test/_test_multiprocessing.py
 +++ b/Lib/test/_test_multiprocessing.py
-@@ -1437,6 +1437,7 @@ class _TestCondition(BaseTestCase):
+@@ -1521,6 +1521,7 @@ class _TestCondition(BaseTestCase):
                  success.value = True
  
      @unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
@@ -90,7 +90,7 @@
      def test_waitfor_timeout(self):
          # based on test in test/lock_tests.py
          cond = self.Condition()
-@@ -2304,6 +2305,7 @@ class _TestPool(BaseTestCase):
+@@ -2411,6 +2412,7 @@ class _TestPool(BaseTestCase):
          self.assertEqual(get(), 49)
          self.assertTimingAlmostEqual(get.elapsed, TIMEOUT1)
  
@@ -98,7 +98,7 @@
      def test_async_timeout(self):
          res = self.pool.apply_async(sqr, (6, TIMEOUT2 + 1.0))
          get = TimingWrapper(res.get)
-@@ -4039,6 +4041,7 @@ class TestWait(unittest.TestCase):
+@@ -4564,6 +4566,7 @@ class TestWait(unittest.TestCase):
          sem.release()
          time.sleep(period)
  
@@ -108,15 +108,15 @@
  
 --- a/Lib/test/test_asyncio/test_events.py
 +++ b/Lib/test/test_asyncio/test_events.py
-@@ -263,6 +263,7 @@ class EventLoopTestsMixin:
+@@ -266,6 +266,7 @@ class EventLoopTestsMixin:
      # Note: because of the default Windows timing granularity of
      # 15.6 msec, we use fairly long sleep times here (~100 msec).
  
 +    @unittest.skip("transient failure on PowerPC")
      def test_run_until_complete(self):
          t0 = self.loop.time()
-         self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop))
-@@ -290,7 +291,7 @@ class EventLoopTestsMixin:
+         self.loop.run_until_complete(asyncio.sleep(0.1))
+@@ -293,7 +294,7 @@ class EventLoopTestsMixin:
          self.loop.run_forever()
          t1 = time.monotonic()
          self.assertEqual(results, ['hello world'])
@@ -125,7 +125,7 @@
  
      def test_call_soon(self):
          results = []
-@@ -576,6 +577,7 @@ class EventLoopTestsMixin:
+@@ -478,6 +479,7 @@ class EventLoopTestsMixin:
          self.assertEqual(caught, 1)
  
      @unittest.skipUnless(hasattr(signal, 'SIGALRM'), 'No SIGALRM')
@@ -135,7 +135,7 @@
          caught = 0
 --- a/Lib/test/test_buffer.py
 +++ b/Lib/test/test_buffer.py
-@@ -2483,6 +2483,7 @@ class TestBufferProtocol(unittest.TestCa
+@@ -2504,6 +2504,7 @@ class TestBufferProtocol(unittest.TestCa
          a = ndarray(items, shape=[2, 2, 2], format="b")
          check(memoryview(a), vsize(base_struct + 3 * per_dim))
  

++++++ subprocess-raise-timeout.patch ++++++
--- /var/tmp/diff_new_pack.nz6JWA/_old  2020-03-08 22:22:39.804022891 +0100
+++ /var/tmp/diff_new_pack.nz6JWA/_new  2020-03-08 22:22:39.804022891 +0100
@@ -1,8 +1,6 @@
-Index: Python-3.7.0/Lib/test/test_subprocess.py
-===================================================================
---- Python-3.7.0.orig/Lib/test/test_subprocess.py
-+++ Python-3.7.0/Lib/test/test_subprocess.py
-@@ -1088,7 +1088,8 @@ class ProcessTestCase(BaseTestCase):
+--- a/Lib/test/test_subprocess.py
++++ b/Lib/test/test_subprocess.py
+@@ -1124,7 +1124,8 @@ class ProcessTestCase(BaseTestCase):
          self.assertIn("0.0001", str(c.exception))  # For coverage of __str__.
          # Some heavily loaded buildbots (sparc Debian 3.x) require this much
          # time to start.


Reply via email to