SHA256
1
0
forked from pool/python38

- Update to 3.8.9:

- bpo#42988 (bsc#1183374) CVE-2021-3426: Remove the getfile
    feature of the pydoc module which could be abused to read
    arbitrary files on the disk (directory traversal
    vulnerability). Moreover, even source code of Python modules
    can contain sensitive data like passwords. Vulnerability
    reported by David Schwörer.
  - bpo-43285: ftplib no longer trusts the IP address value
    returned from the server in response to the PASV command by
    default. This prevents a malicious FTP server from using the
    response to probe IPv4 address and port combinations on the
    client network.
  - Code that requires the former vulnerable behavior may set
    a trust_server_pasv_ipv4_address attribute on their
    ftplib.FTP instances to True to re-enable it.
  - bpo-43439: Add audit hooks for gc.get_objects(),
    gc.get_referrers() and gc.get_referents(). Patch by Pablo
    Galindo.
  - bpo-43660: Fix crash that happens when replacing sys.stderr
    with a callable that can remove the object while an exception
    is being printed. Patch by Pablo Galindo.
  - bpo-35883: Python no longer fails at startup with a fatal
    error if a command line argument contains an invalid Unicode
    character. The Py_DecodeLocale() function now escapes byte
    sequences which would be decoded as Unicode characters
    outside the [U+0000; U+10ffff] range.
  - bpo-43406: Fix a possible race condition where
    PyErr_CheckSignals tries to execute a non-Python signal
    handler.
  - bpo-35930: Raising an exception raised in a “future” instance

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=62
This commit is contained in:
Matej Cepl 2021-04-28 17:38:20 +00:00 committed by Git OBS Bridge
parent 988a108da4
commit 8d39a136b6
8 changed files with 393 additions and 292 deletions

View File

@ -19,17 +19,17 @@ Co-authored-by: Petr Viktorin <pviktori@redhat.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
---
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 +++---
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
@ -183,7 +183,7 @@ Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
}
--- a/configure
+++ b/configure
@@ -15233,9 +15233,9 @@ fi
@@ -15222,9 +15222,9 @@ fi
if test x$PLATFORM_TRIPLET = x; then
@ -197,7 +197,7 @@ Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
--- a/configure.ac
+++ b/configure.ac
@@ -4691,9 +4691,9 @@ fi
@@ -4698,9 +4698,9 @@ fi
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
AC_SUBST(PY_ENABLE_SHARED)
if test x$PLATFORM_TRIPLET = x; then

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c664249ff77e443d6ea0e4cf0e587eae918ca3c48d081d1915fe2a1f1bcc5cc
size 18271736

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAmAvnWsACgkQsmmV4xAl
BWg3AxAAgyphcmlW0p0WgLASBlOIXy/vOLqihJp8v1PDQaAnWA1FdEagfoqcQXTH
LDf3Dt5snlzOu2z5LKFlWgDmCtImLbpkRBeTIDaUGJNCXPY0EgjodEBL09KfJJTl
cUtb8mmJQHxAq9IBRGBc55XO7PY8VAxc+8yMl6dzGmPStVps7zKRqhUmH33u3asV
HKhT1ENlNe4ZYs4j9wbZjZynam6OVKQ75S9wA9KE9WHMsAYs9DVWO8tGXPxRBZuA
d5Y3lx164kyz2UMju5LvlsCSdKNLQq2/Tdz1h+Lnc1yepqyq43Kt4rhyDZ6Su3LX
D3fdyHBMjL3eXj3rPwYMzFTy05y9cTN8OODv16Yd/8WhiadiyDrlF5Vwgr8pGk15
gpfiwuOyGkTfbl4HLUwM/7gb/ca/W2XTJXz+Izb+AhOFsdtNQ9F35zawvmlxGC/J
WjyordAlC0Lnjgtf/hI9oIVy0f/927hfY3KNDglYVNbrwtoREjcEBMWeEoUuYK73
LfFZms6ujvaPfTri1ygDcv+m8l6wJTOPysb7jtBWVyZr9D/Xl7PuRMvI0mflOvCq
IdFsoMm+7OKicgUjfBVkggFp7kf+Vv7nFV2WLHtJHphoSZ710Yn7ie1E0gO1pRyV
MsHbYiEu5uAVfEX/aXCjUZbgkrEchO6+4FHZy5MXsxO1gUX+ubI=
=KNuF
-----END PGP SIGNATURE-----

3
Python-3.8.9.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5e391f3ec45da2954419cab0beaefd8be38895ea5ce33577c3ec14940c4b9572
size 18271948

16
Python-3.8.9.tar.xz.asc Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAmBm/igACgkQsmmV4xAl
BWiJUQ/+KTgmV3FEBL25Yjtude5KgsjyCia1HYhkD2ou/rI8ATZcL+buHc8eENlG
0T0h4rDgggTjlBfK6H7Stj8u9GjKpMzj6RHKiOWEue3EuJo3G5JxHubEJ2graOWG
EYPoCFbZPlIt+FVFtXf/NTWic9qVxRRhzhNNzz23EFWToTHQxzt4ay+5y2QCGuC3
0+6r9lvWurlSR1U2mlRLHtzmt8WyhCq5k3fEITI7eIxBVM1o4/sicE91PuFLnSF3
Rbo0aG47cDqTJMFV70Q4ztExexAWB6uoPP+j+p25+IVWhO4UUSWTh+nfSvYZQHAC
ceS6POUifhBJI/4OGucRquzzCb6XYtI/Sevs9iFY57wteyxuEZTyhdUO8AS2LOlK
uCIeNvF8g1L1rSNCUHn/zQCbokvH1WSQMbiECJILmDMc2Bi7T5lw2letab/qsciw
63jIWvaagEGoH+YSo/kgUNlgNQVzvgOluXo4jbNQWaQje0CilT5MU/9BkbpbVFpA
IxKQhZ6PTA53f3lgTxCrCNXWigr51+M+GFHXtNxi4gQL7vdtFvZBy+ukl5DfkNfN
3CmL7ffxKI8OQp2kPG2lTGV2NWyQA0eHpUQ0n41os116tj9k6evhWYRsfjFKoNd3
Nvk2p+niV1GkQDKkHHShTJg0IdUQIXGmhtqMsMQOlnE9ycpOppo=
=qxhm
-----END PGP SIGNATURE-----

View File

@ -1,34 +1,248 @@
--- a/configure.ac
+++ b/configure.ac
@@ -4688,12 +4688,26 @@ else
LIBPYTHON=''
fi
---
Lib/distutils/command/install.py | 18 +++++++++---------
Lib/distutils/sysconfig.py | 7 ++-----
Lib/site.py | 19 +++++++++----------
Lib/sysconfig.py | 12 ++++++------
Lib/test/test_embed.py | 10 +++++++---
Lib/test/test_site.py | 7 +++++--
Lib/test/test_sysconfig.py | 14 +++++++++++++-
Makefile.pre.in | 6 +++++-
Modules/getpath.c | 24 ++++++++++++------------
configure | 4 ++--
configure.ac | 18 ++++++++++++++++--
setup.py | 6 +++---
12 files changed, 89 insertions(+), 56 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/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).
+# 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)
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/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/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/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
@@ -1072,12 +1073,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'),
]
@@ -1188,13 +1190,15 @@ class InitConfigTests(EmbeddingTestsMixi
def test_init_pyvenv_cfg(self):
# Test path configuration with pyvenv.cfg configuration file
+ platsubdir = sysconfig.get_config_var('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)
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)
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -267,8 +267,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/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -137,13 +137,16 @@ exec_prefix= @exec_prefix@
@ -125,196 +339,9 @@
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
@@ -267,8 +267,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
@@ -15233,9 +15233,9 @@ fi
@@ -15222,9 +15222,9 @@ fi
if test x$PLATFORM_TRIPLET = x; then
@ -326,6 +353,37 @@
fi
--- a/configure.ac
+++ b/configure.ac
@@ -4695,12 +4695,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/setup.py
+++ b/setup.py
@@ -649,7 +649,7 @@ class PyBuildExt(build_ext):
@ -351,46 +409,3 @@
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
@@ -1072,12 +1073,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'),
]
@@ -1188,13 +1190,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)

View File

@ -1,3 +1,89 @@
-------------------------------------------------------------------
Wed Apr 28 17:32:55 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Update to 3.8.9:
- bpo#42988 (bsc#1183374) CVE-2021-3426: Remove the getfile
feature of the pydoc module which could be abused to read
arbitrary files on the disk (directory traversal
vulnerability). Moreover, even source code of Python modules
can contain sensitive data like passwords. Vulnerability
reported by David Schwörer.
- bpo-43285: ftplib no longer trusts the IP address value
returned from the server in response to the PASV command by
default. This prevents a malicious FTP server from using the
response to probe IPv4 address and port combinations on the
client network.
- Code that requires the former vulnerable behavior may set
a trust_server_pasv_ipv4_address attribute on their
ftplib.FTP instances to True to re-enable it.
- bpo-43439: Add audit hooks for gc.get_objects(),
gc.get_referrers() and gc.get_referents(). Patch by Pablo
Galindo.
- bpo-43660: Fix crash that happens when replacing sys.stderr
with a callable that can remove the object while an exception
is being printed. Patch by Pablo Galindo.
- bpo-35883: Python no longer fails at startup with a fatal
error if a command line argument contains an invalid Unicode
character. The Py_DecodeLocale() function now escapes byte
sequences which would be decoded as Unicode characters
outside the [U+0000; U+10ffff] range.
- bpo-43406: Fix a possible race condition where
PyErr_CheckSignals tries to execute a non-Python signal
handler.
- bpo-35930: Raising an exception raised in a “future” instance
will create reference cycles.
- bpo-43577: Fix deadlock when using ssl.SSLContext debug
callback with ssl.SSLContext.sni_callback().
- bpo-43423: subprocess.communicate() no longer raises an
IndexError when there is an empty stdout or stderr IO buffer
during a timeout on Windows.
- bpo-27820: Fixed long-standing bug of smtplib.SMTP where
doing AUTH LOGIN with initial_response_ok=False will fail.
The cause is that SMTP.auth_login _always_ returns a password
if provided with a challenge string, thus non-compliant with
the standard for AUTH LOGIN. Also fixes bug with the test for
smtpd.
- bpo-43399: Fix ElementTree.extend not working on iterators
when using the Python implementation
- bpo-43316: The python -m gzip command line application now
properly fails when detecting an unsupported extension. It
exits with a non-zero exit code and prints an error message
to stderr.
- bpo-43260: Fix TextIOWrapper can not flush internal buffer
forever after very large text is written.
- bpo-42782: Fail fast in shutil.move() to avoid creating
destination directories on failure.
- bpo-37193: Fixed memory leak in socketserver.ThreadingMixIn
introduced in Python 3.7.
- bpo-43199: Answer “Why is there no goto?” in the Design and
History FAQ.
- bpo-43407: Clarified that a result from time.monotonic(),
time.perf_counter(), time.process_time(), or
time.thread_time() can be compared with the result from any
following call to the same function - not just the next
immediate call.
- bpo-27646: Clarify that yield from <expr> works with any
iterable, not just iterators.
- bpo-36346: Update some deprecated unicode APIs which are
documented as “will be removed in 4.0” to “3.12”. See PEP 623
for detail.
- bpo-37945: Fix test_getsetlocale_issue1813() of test_locale:
skip the test if setlocale() fails. Patch by Victor Stinner.
- bpo-41561: Add workaround for Ubuntus custom OpenSSL
security level policy.
- bpo-43631: Update macOS, Windows, and CI to OpenSSL 1.1.1k.
- bpo-43617: Improve configure.ac: Check for presence of
autoconf-archive package and remove our copies of M4 macros.
- bpo-41837: Update macOS installer build to use OpenSSL
1.1.1j.
- bpo-42225: Document that IDLE can fail on Unix either from
misconfigured IP masquerage rules or failure displaying
complex colored (non-ascii) characters.
- bpo-43283: Document why printing to IDLEs Shell is often
slower than printing to a system terminal and that it can be
made faster by pre-formatting a single string before
printing.
-------------------------------------------------------------------
Fri Feb 19 16:40:59 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

@ -87,7 +87,7 @@
%bcond_without profileopt
%endif
Name: %{python_pkg_name}%{psuffix}
Version: 3.8.8
Version: 3.8.9
Release: 0
Summary: Python 3 Interpreter
License: Python-2.0