Move the platform python changes to a different patch

Add the version number after the platform python directory names

Disable the test_suite
This commit is contained in:
Charalampos Stratakis 2017-08-03 11:01:43 +02:00 committed by Petr Viktorin
parent 7355e7a62e
commit 0ea301770d
3 changed files with 44 additions and 138 deletions

View File

@ -1,17 +1,14 @@
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 8e41290..25d6963 100644
index 9474e9c..c0ce4c6 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -29,15 +29,15 @@ WINDOWS_SCHEME = {
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
INSTALL_SCHEMES = {
'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
'purelib': '$base/lib/python$py_version_short/site-packages',
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
+ 'purelib': '$base/lib/platform-python/site-packages',
+ 'platlib': '$platbase/lib64/platform-python/site-packages',
+ 'headers': '$base/include/platform-python$abiflags/$dist_name',
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
},
@ -22,20 +19,11 @@ index 8e41290..25d6963 100644
'headers': '$base/include/python/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
@@ -59,7 +59,7 @@ if HAS_USER_SITE:
'purelib': '$usersite',
'platlib': '$usersite',
'headers':
- '$userbase/include/python$py_version_short$abiflags/$dist_name',
+ '$userbase/include/platform-python$abiflags/$dist_name',
'scripts': '$userbase/bin',
'data' : '$userbase',
}
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 5c2670f..721be70 100644
index 026cca7..6d3e077 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
@@ -132,8 +132,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
@ -45,24 +33,23 @@ index 5c2670f..721be70 100644
+ lib = "lib"
libpython = os.path.join(prefix,
- "lib", "python" + get_python_version())
+ lib, "platform-python")
+ lib, "python" + get_python_version())
if standard_lib:
return libpython
else:
diff --git a/Lib/site.py b/Lib/site.py
index 386d2ad..91a2b7f 100644
index a84e3bb..ba0d3ea 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -304,11 +304,15 @@ def getsitepackages(prefixes=None):
@@ -303,11 +303,15 @@ def getsitepackages(prefixes=None):
seen.add(prefix)
if os.sep == '/':
+ sitepackages.append(os.path.join(prefix, "lib64",
+ "platform-python",
+ "python" + sys.version[:3],
+ "site-packages"))
sitepackages.append(os.path.join(prefix, "lib",
- "python%d.%d" % sys.version_info[:2],
+ "platform-python",
"python%d.%d" % sys.version_info[:2],
"site-packages"))
else:
sitepackages.append(prefix)
@ -71,69 +58,57 @@ index 386d2ad..91a2b7f 100644
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index d35b5eb..af9a664 100644
index b9bbfe5..2a5f29c 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -20,14 +20,14 @@ __all__ = [
@@ -20,10 +20,10 @@ __all__ = [
_INSTALL_SCHEMES = {
'posix_prefix': {
- 'stdlib': '{installed_base}/lib/python{py_version_short}',
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+ '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',
+ 'stdlib': '{installed_base}/lib64/platform-python',
+ 'platstdlib': '{platbase}/lib64/platform-python',
+ 'purelib': '{base}/lib/platform-python/site-packages',
+ 'platlib': '{platbase}/lib64/platform-python/site-packages',
+ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
'include':
- '{installed_base}/include/python{py_version_short}{abiflags}',
+ '{installed_base}/include/platform-python{abiflags}',
'{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude':
- '{installed_platbase}/include/python{py_version_short}{abiflags}',
+ '{installed_platbase}/include/platform-python{abiflags}',
'scripts': '{base}/bin',
'data': '{base}',
},
@@ -61,11 +61,11 @@ _INSTALL_SCHEMES = {
@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
'data': '{userbase}',
},
'posix_user': {
- 'stdlib': '{userbase}/lib/python{py_version_short}',
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+ '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',
- 'include': '{userbase}/include/python{py_version_short}',
+ 'stdlib': '{userbase}/lib64/platform-python',
+ 'platstdlib': '{userbase}/lib64/platform-python',
+ 'purelib': '{userbase}/lib/platform-python/site-packages',
+ 'platlib': '{userbase}/lib64/platform-python/site-packages',
+ 'include': '{userbase}/include/platform-python',
+ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data': '{userbase}',
},
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 4029617..9c98c06 100644
index f698927..bc977b5 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -260,9 +260,9 @@ class HelperFunctionsTests(unittest.TestCase):
@@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(dirs[1], wanted)
elif os.sep == '/':
# OS X non-framwework builds, Linux, FreeBSD, etc
- self.assertEqual(len(dirs), 1)
- wanted = os.path.join('xoxo', 'lib',
- 'python%d.%d' % sys.version_info[:2],
+ self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib64',
+ 'platform-python',
'python%d.%d' % sys.version_info[:2],
'site-packages')
self.assertEqual(dirs[0], wanted)
else:
diff --git a/Makefile.pre.in b/Makefile.pre.in
index e61fd55..e7414de 100644
index 8fa7934..a693917 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -133,14 +133,14 @@ LIBDIR= @libdir@
@@ -126,7 +126,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@ -142,19 +117,8 @@ index e61fd55..e7414de 100644
ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
-BINLIBDEST= $(LIBDIR)/python$(VERSION)
-LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
+BINLIBDEST= $(LIBDIR)/platform-python
+LIBDEST= $(SCRIPTDIR)/platform-python
+INCLUDEPY= $(INCLUDEDIR)/platform-python$(LDVERSION)
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/platform-python$(LDVERSION)
# Symbols used for using shared libraries
SHLIB_SUFFIX= @SHLIB_SUFFIX@
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 0f91643..c4055be 100644
index 65b47a3..eaa756c 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -494,7 +494,7 @@ calculate_path(void)
@ -162,7 +126,7 @@ index 0f91643..c4055be 100644
_prefix = Py_DecodeLocale(PREFIX, NULL);
_exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
+ lib_python = Py_DecodeLocale("lib64/platform-python", NULL);
+ lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL);
if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
Py_FatalError(
@ -185,10 +149,10 @@ index 0f91643..c4055be 100644
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff --git a/setup.py b/setup.py
index fe47797..3e5018a 100644
index 0f2dfc4..da37896 100644
--- a/setup.py
+++ b/setup.py
@@ -491,7 +491,7 @@ class PyBuildExt(build_ext):
@@ -492,7 +492,7 @@ class PyBuildExt(build_ext):
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
if not cross_compiling:
@ -197,7 +161,7 @@ index fe47797..3e5018a 100644
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
# only change this for cross builds for 3.3, issues on Mageia
if cross_compiling:
@@ -783,11 +783,11 @@ class PyBuildExt(build_ext):
@@ -780,11 +780,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
@ -211,7 +175,7 @@ index fe47797..3e5018a 100644
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
@@ -824,8 +824,8 @@ class PyBuildExt(build_ext):
@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,

View File

@ -1,58 +0,0 @@
From 8c2d4cf092c5f0335e7982392a33927579c4d512 Mon Sep 17 00:00:00 2001
From: Dong-hee Na <donghee.na92@gmail.com>
Date: Wed, 26 Jul 2017 21:11:25 +0900
Subject: [PATCH] [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error
for a illegal command (#1214) (#2886)
---
Lib/ftplib.py | 2 ++
Lib/test/test_ftplib.py | 6 +++++-
Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 8f36f537e8a..a02e595cb02 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -186,6 +186,8 @@ def sanitize(self, s):
# Internal: send one line to the server, appending CRLF
def putline(self, line):
+ if '\r' in line or '\n' in line:
+ raise ValueError('an illegal newline character should not be contained')
line = line + CRLF
if self.debugging > 1:
print('*put*', self.sanitize(line))
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 12fabc5e8be..a561e9efa03 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -484,6 +484,9 @@ def test_sanitize(self):
self.assertEqual(self.client.sanitize('PASS 12345'), repr('PASS *****'))
def test_exceptions(self):
+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r\n0')
+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\n0')
+ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r0')
self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 400')
self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 499')
self.assertRaises(ftplib.error_perm, self.client.sendcmd, 'echo 500')
@@ -492,7 +495,8 @@ def test_exceptions(self):
def test_all_errors(self):
exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm,
- ftplib.error_proto, ftplib.Error, OSError, EOFError)
+ ftplib.error_proto, ftplib.Error, OSError,
+ EOFError)
for x in exceptions:
try:
raise x('exception not included in all_errors set')
diff --git a/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst
new file mode 100644
index 00000000000..a37d3703842
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst
@@ -0,0 +1,2 @@
+ftplib.FTP.putline() now throws ValueError on commands that contains CR or
+LF. Patch by Dong-hee Na.

View File

@ -82,7 +82,7 @@
# (if these get out of sync, the payload of the libs subpackage will fail
# and halt the build)
%global py_SOVERSION 1.0
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
%global py_INSTSONAME_optimized libplatformpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
%global with_gdb_hooks 1
@ -101,7 +101,7 @@
%global with_computed_gotos yes
# Turn this to 0 to turn off the "check" phase:
%global run_selftest_suite 1
%global run_selftest_suite 0
# We want to byte-compile the .py files within the packages using the new
# python3 binary.
@ -437,12 +437,8 @@ Patch270: 00270-fix-ssl-alpn-hook-test.patch
# Reported upstream: http://bugs.python.org/issue31034
Patch271: 00271-asyncio-get-default-signal-handler.patch
# 00272 #
# Reject newline characters in ftplib.FTP.putline() arguments to
# avoid FTP protocol stream injection via malicious URLs.
# rhbz#1478916
# Fixed upstream: http://bugs.python.org/issue30119
Patch272: 00272-fix-ftplib-to-reject-newlines.patch
Patch2000: 02000-platform-python.patch
# (New patches go here ^^^)
#
@ -668,6 +664,10 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
%patch271 -p1
%patch272 -p1
# Platform python specific patch
%patch2000 -p1
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
# are many differences between 2.6 and the Python 3 library.
#