#32 Update to 3.6.5
Merged 6 years ago by cstratak. Opened 6 years ago by cstratak.
rpms/ cstratak/python3 f26  into  f26

file modified
+1 -1
@@ -96,7 +96,7 @@ 

  @@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase):

               self.assertEqual(dirs[1], wanted)

           elif os.sep == '/':

-              # OS X non-framwework builds, Linux, FreeBSD, etc

+              # OS X non-framework builds, Linux, FreeBSD, etc

  -            self.assertEqual(len(dirs), 1)

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

  +            self.assertEqual(len(dirs), 2)

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

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

- index 70e5927..04c8e3d 100644

+ index 4b093e3..1088435 100644

  --- a/Makefile.pre.in

  +++ b/Makefile.pre.in

- @@ -556,7 +556,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c

-  	$(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make

+ @@ -543,7 +543,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c

+  	$(PYTHON_FOR_REGEN) ./Tools/clinic/clinic.py --make

   

   # Build the interpreter

  -$(BUILDPYTHON):	Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
@@ -11,7 +11,7 @@ 

   	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

   

   platform: $(BUILDPYTHON) pybuilddir.txt

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

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

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

   

   
@@ -30,7 +30,7 @@ 

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

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

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

- @@ -702,7 +690,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist

+ @@ -689,7 +677,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist

   		echo "-----------------------------------------------"; \

   	fi

   
@@ -39,7 +39,7 @@ 

   	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

   

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

- @@ -1382,18 +1370,6 @@ libainstall:	all python-config

+ @@ -1425,18 +1413,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config

   		else	true; \

   		fi; \

   	done

@@ -542,18 +542,6 @@ 

  index ae2bcd4..0a302ff 100644

  --- a/Lib/test/test_cmd_line.py

  +++ b/Lib/test/test_cmd_line.py

- @@ -9,8 +9,9 @@ import sys

-  import subprocess

-  import tempfile

-  from test.support import script_helper, is_android

- -from test.support.script_helper import (spawn_python, kill_python, assert_python_ok,

- -    assert_python_failure)

- +from test.support.script_helper import (

- +    spawn_python, kill_python, assert_python_ok, assert_python_failure

- +)

-  

-  

-  # XXX (ncoghlan): Move to script_helper and make consistent with run_python

  @@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase):

           env = os.environ.copy()

           # Use C locale to get ascii for the locale encoding

@@ -1,12 +0,0 @@ 

- diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py

- index 3eded77..ad7859a 100644

- --- a/Lib/ctypes/test/test_structures.py

- +++ b/Lib/ctypes/test/test_structures.py

- @@ -392,6 +392,7 @@ class StructureTestCase(unittest.TestCase):

-                           (1, 0, 0, 0, 0, 0))

-          self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7))

-  

- +    @unittest.skip('Fails on aarch64: http://bugs.python.org/issue29804')

-      def test_pass_by_value(self):

-          # This should mirror the structure in Modules/_ctypes/_ctypes_test.c

-          class X(Structure):

@@ -1,16 +0,0 @@ 

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

- index d203cdd..c128dae 100644

- --- a/Lib/test/test_ssl.py

- +++ b/Lib/test/test_ssl.py

- @@ -3256,8 +3256,9 @@ if _have_threads:

-                  except ssl.SSLError as e:

-                      stats = e

-  

- -                if expected is None and IS_OPENSSL_1_1:

- -                    # OpenSSL 1.1.0 raises handshake error

- +                if (expected is None and IS_OPENSSL_1_1

- +                        and ssl.OPENSSL_VERSION_INFO < (1, 1, 0, 6)):

- +                    # OpenSSL 1.1.0 to 1.1.0e raises handshake error

-                      self.assertIsInstance(stats, ssl.SSLError)

-                  else:

-                      msg = "failed trying %s (s) and %s (c).\n" \

@@ -1,99 +0,0 @@ 

- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py

- index 492a84a2313..9746678607c 100644

- --- a/Lib/test/test_asyncio/test_events.py

- +++ b/Lib/test/test_asyncio/test_events.py

- @@ -1980,19 +1980,26 @@ def test_subprocess_terminate(self):

-  

-      @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP")

-      def test_subprocess_send_signal(self):

- -        prog = os.path.join(os.path.dirname(__file__), 'echo.py')

- -

- -        connect = self.loop.subprocess_exec(

- -                        functools.partial(MySubprocessProtocol, self.loop),

- -                        sys.executable, prog)

- -        transp, proto = self.loop.run_until_complete(connect)

- -        self.assertIsInstance(proto, MySubprocessProtocol)

- -        self.loop.run_until_complete(proto.connected)

- -

- -        transp.send_signal(signal.SIGHUP)

- -        self.loop.run_until_complete(proto.completed)

- -        self.assertEqual(-signal.SIGHUP, proto.returncode)

- -        transp.close()

- +        # bpo-31034: Make sure that we get the default signal handler (killing

- +        # the process). The parent process may have decided to ignore SIGHUP,

- +        # and signal handlers are inherited.

- +        old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL)

- +        try:

- +            prog = os.path.join(os.path.dirname(__file__), 'echo.py')

- +

- +            connect = self.loop.subprocess_exec(

- +                            functools.partial(MySubprocessProtocol, self.loop),

- +                            sys.executable, prog)

- +            transp, proto = self.loop.run_until_complete(connect)

- +            self.assertIsInstance(proto, MySubprocessProtocol)

- +            self.loop.run_until_complete(proto.connected)

- +

- +            transp.send_signal(signal.SIGHUP)

- +            self.loop.run_until_complete(proto.completed)

- +            self.assertEqual(-signal.SIGHUP, proto.returncode)

- +            transp.close()

- +        finally:

- +            signal.signal(signal.SIGHUP, old_handler)

-  

-      def test_subprocess_stderr(self):

-          prog = os.path.join(os.path.dirname(__file__), 'echo2.py')

- diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py

- index 2e14a8a9735..e8822c36698 100644

- --- a/Lib/test/test_asyncio/test_subprocess.py

- +++ b/Lib/test/test_asyncio/test_subprocess.py

- @@ -166,25 +166,32 @@ def test_terminate(self):

-  

-      @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP")

-      def test_send_signal(self):

- -        code = 'import time; print("sleeping", flush=True); time.sleep(3600)'

- -        args = [sys.executable, '-c', code]

- -        create = asyncio.create_subprocess_exec(*args,

- -                                                stdout=subprocess.PIPE,

- -                                                loop=self.loop)

- -        proc = self.loop.run_until_complete(create)

- -

- -        @asyncio.coroutine

- -        def send_signal(proc):

- -            # basic synchronization to wait until the program is sleeping

- -            line = yield from proc.stdout.readline()

- -            self.assertEqual(line, b'sleeping\n')

- +        # bpo-31034: Make sure that we get the default signal handler (killing

- +        # the process). The parent process may have decided to ignore SIGHUP,

- +        # and signal handlers are inherited.

- +        old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL)

- +        try:

- +            code = 'import time; print("sleeping", flush=True); time.sleep(3600)'

- +            args = [sys.executable, '-c', code]

- +            create = asyncio.create_subprocess_exec(*args,

- +                                                    stdout=subprocess.PIPE,

- +                                                    loop=self.loop)

- +            proc = self.loop.run_until_complete(create)

-  

- -            proc.send_signal(signal.SIGHUP)

- -            returncode = (yield from proc.wait())

- -            return returncode

- -

- -        returncode = self.loop.run_until_complete(send_signal(proc))

- -        self.assertEqual(-signal.SIGHUP, returncode)

- +            @asyncio.coroutine

- +            def send_signal(proc):

- +                # basic synchronization to wait until the program is sleeping

- +                line = yield from proc.stdout.readline()

- +                self.assertEqual(line, b'sleeping\n')

- +

- +                proc.send_signal(signal.SIGHUP)

- +                returncode = (yield from proc.wait())

- +                return returncode

- +

- +            returncode = self.loop.run_until_complete(send_signal(proc))

- +            self.assertEqual(-signal.SIGHUP, returncode)

- +        finally:

- +            signal.signal(signal.SIGHUP, old_handler)

-  

-      def prepare_broken_pipe_test(self):

-          # buffer large enough to feed the whole pipe buffer

@@ -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.

@@ -1,43 +0,0 @@ 

- From 54849962eacc38f4e6c6f8a72ae258b3e7c2ecd5 Mon Sep 17 00:00:00 2001

- From: Victor Stinner <victor.stinner@gmail.com>

- Date: Thu, 5 Oct 2017 15:05:30 +0200

- Subject: [PATCH] bpo-31178: Mock os.waitpid() in test_subprocess

- 

- Fix test_exception_errpipe_bad_data() and

- test_exception_errpipe_normal() of test_subprocess: mock os.waitpid()

- to avoid calling the real os.waitpid(0, 0) which is an unexpected

- side effect of the test.

- ---

-  Lib/test/test_subprocess.py | 12 ++++++++----

-  1 file changed, 8 insertions(+), 4 deletions(-)

- 

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

- index 00dc37bc2c7..3ba5c028517 100644

- --- a/Lib/test/test_subprocess.py

- +++ b/Lib/test/test_subprocess.py

- @@ -1559,8 +1559,10 @@ def proper_error(*args):

-  

-          fork_exec.side_effect = proper_error

-  

- -        with self.assertRaises(IsADirectoryError):

- -            self.PopenNoDestructor(["non_existent_command"])

- +        with mock.patch("subprocess.os.waitpid",

- +                        side_effect=ChildProcessError):

- +            with self.assertRaises(IsADirectoryError):

- +                self.PopenNoDestructor(["non_existent_command"])

-  

-      @mock.patch("subprocess._posixsubprocess.fork_exec")

-      def test_exception_errpipe_bad_data(self, fork_exec):

- @@ -1577,8 +1579,10 @@ def bad_error(*args):

-  

-          fork_exec.side_effect = bad_error

-  

- -        with self.assertRaises(subprocess.SubprocessError) as e:

- -            self.PopenNoDestructor(["non_existent_command"])

- +        with mock.patch("subprocess.os.waitpid",

- +                        side_effect=ChildProcessError):

- +            with self.assertRaises(subprocess.SubprocessError) as e:

- +                self.PopenNoDestructor(["non_existent_command"])

-  

-          self.assertIn(repr(error_data), str(e.exception))

-  

@@ -1,13 +0,0 @@ 

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

- index c4055be..1258fcd 100644

- --- a/Modules/getpath.c

- +++ b/Modules/getpath.c

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

-      bufsz += wcslen(zip_path) + 1;

-      bufsz += wcslen(exec_prefix) + 1;

-  

- -    buf = PyMem_New(wchar_t, bufsz);

- +    buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t));

-      if (buf == NULL) {

-          Py_FatalError(

-              "Not enough memory for dynamic PYTHONPATH");

@@ -1,60 +0,0 @@ 

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

- index df8c6a7d96d8..e8cffef14de0 100644

- --- a/Modules/_ssl.c

- +++ b/Modules/_ssl.c

- @@ -55,6 +55,11 @@ static PySocketModule_APIObject PySocketModule;

-  #include <sys/poll.h>

-  #endif

-  

- +#ifndef MS_WINDOWS

- +/* inet_pton */

- +#include <arpa/inet.h>

- +#endif

- +

-  /* Don't warn about deprecated functions */

-  #ifdef __GNUC__

-  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"

- @@ -667,8 +672,41 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,

-      SSL_set_mode(self->ssl, mode);

-  

-  #if HAVE_SNI

- -    if (server_hostname != NULL)

- -        SSL_set_tlsext_host_name(self->ssl, server_hostname);

- +    if (server_hostname != NULL) {

- +/* Don't send SNI for IP addresses. We cannot simply use inet_aton() and

- + * inet_pton() here. inet_aton() may be linked weakly and inet_pton() isn't

- + * available on all platforms. Use OpenSSL's IP address parser. It's

- + * available since 1.0.2 and LibreSSL since at least 2.3.0. */

- +        int send_sni = 1;

- +#if OPENSSL_VERSION_NUMBER >= 0x10200000L

- +        ASN1_OCTET_STRING *ip = a2i_IPADDRESS(server_hostname);

- +        if (ip == NULL) {

- +            send_sni = 1;

- +            ERR_clear_error();

- +        } else {

- +            send_sni = 0;

- +            ASN1_OCTET_STRING_free(ip);

- +        }

- +#elif defined(HAVE_INET_PTON)

- +#ifdef ENABLE_IPV6

- +        char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];

- +#else

- +        char packed[sizeof(struct in_addr)];

- +#endif /* ENABLE_IPV6 */

- +        if (inet_pton(AF_INET, server_hostname, packed)) {

- +            send_sni = 0;

- +#ifdef ENABLE_IPV6

- +        } else if(inet_pton(AF_INET6, server_hostname, packed)) {

- +            send_sni = 0;

- +#endif /* ENABLE_IPV6 */

- +        } else {

- +            send_sni = 1;

- +        }

- +#endif /* HAVE_INET_PTON */

- +        if (send_sni) {

- +            SSL_set_tlsext_host_name(self->ssl, server_hostname);

- +        }

- +    }

-  #endif

-  

-      /* If the socket is in non-blocking mode or timeout mode, set the BIO

@@ -0,0 +1,104 @@ 

+ From 5affd5c29eb1493cb31ef3cfdde15538ac134689 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Tue, 13 Mar 2018 10:56:43 +0100

+ Subject: [PATCH] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no

+  backup~ (#5772)

+ 

+ Creating backup files with ~ suffix can be undesirable in some environment,

+ such as when building RPM packages. Instead of requiring the user to remove

+ those files manually, option -n was added, that simply disables this feature.

+ 

+ -n was selected because 2to3 has the same option with this behavior.

+ ---

+  Misc/ACKS                                          |  1 +

+  .../2018-02-20-12-16-47.bpo-32885.dL5x7C.rst       |  2 ++

+  Tools/scripts/pathfix.py                           | 28 +++++++++++++++-------

+  3 files changed, 23 insertions(+), 8 deletions(-)

+  create mode 100644 Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst

+ 

+ diff --git a/Misc/ACKS b/Misc/ACKS

+ index d8179c8b03ab..d752d8a35434 100644

+ --- a/Misc/ACKS

+ +++ b/Misc/ACKS

+ @@ -687,6 +687,7 @@ Ken Howard

+  Brad Howes

+  Mike Hoy

+  Ben Hoyt

+ +Miro Hrončok

+  Chiu-Hsiang Hsu

+  Chih-Hao Huang

+  Christian Hudon

+ diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst b/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst

+ new file mode 100644

+ index 000000000000..e003e1d84fd0

+ --- /dev/null

+ +++ b/Misc/NEWS.d/next/Tools-Demos/2018-02-20-12-16-47.bpo-32885.dL5x7C.rst

+ @@ -0,0 +1,2 @@

+ +Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disbale automatic

+ +backup creation (files with ``~`` suffix).

+ diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py

+ index 562bbc737812..c5bf984306a3 100755

+ --- a/Tools/scripts/pathfix.py

+ +++ b/Tools/scripts/pathfix.py

+ @@ -7,8 +7,9 @@

+  # Directories are searched recursively for files whose name looks

+  # like a python module.

+  # Symbolic links are always ignored (except as explicit directory

+ -# arguments).  Of course, the original file is kept as a back-up

+ -# (with a "~" attached to its name).

+ +# arguments).

+ +# The original file is kept as a back-up (with a "~" attached to its name),

+ +# -n flag can be used to disable this.

+  #

+  # Undoubtedly you can do this using find and sed or perl, but this is

+  # a nice example of Python code that recurses down a directory tree

+ @@ -31,14 +32,17 @@

+  

+  new_interpreter = None

+  preserve_timestamps = False

+ +create_backup = True

+ +

+  

+  def main():

+      global new_interpreter

+      global preserve_timestamps

+ -    usage = ('usage: %s -i /interpreter -p file-or-directory ...\n' %

+ +    global create_backup

+ +    usage = ('usage: %s -i /interpreter -p -n file-or-directory ...\n' %

+               sys.argv[0])

+      try:

+ -        opts, args = getopt.getopt(sys.argv[1:], 'i:p')

+ +        opts, args = getopt.getopt(sys.argv[1:], 'i:pn')

+      except getopt.error as msg:

+          err(str(msg) + '\n')

+          err(usage)

+ @@ -48,6 +52,8 @@ def main():

+              new_interpreter = a.encode()

+          if o == '-p':

+              preserve_timestamps = True

+ +        if o == '-n':

+ +            create_backup = False

+      if not new_interpreter or not new_interpreter.startswith(b'/') or \

+             not args:

+          err('-i option or file-or-directory missing\n')

+ @@ -134,10 +140,16 @@ def fix(filename):

+      except OSError as msg:

+          err('%s: warning: chmod failed (%r)\n' % (tempname, msg))

+      # Then make a backup of the original file as filename~

+ -    try:

+ -        os.rename(filename, filename + '~')

+ -    except OSError as msg:

+ -        err('%s: warning: backup failed (%r)\n' % (filename, msg))

+ +    if create_backup:

+ +        try:

+ +            os.rename(filename, filename + '~')

+ +        except OSError as msg:

+ +            err('%s: warning: backup failed (%r)\n' % (filename, msg))

+ +    else:

+ +        try:

+ +            os.remove(filename)

+ +        except OSError as msg:

+ +            err('%s: warning: removing failed (%r)\n' % (filename, msg))

+      # Now move the temp file to the original file

+      try:

+          os.rename(tempname, filename)

file modified
+18 -3
@@ -3,8 +3,23 @@ 

  # Python's compile_all module only works on directories, and requires a max

  # recursion depth

  

+ # Note that the py_byte_compile macro should work for python2 as well

+ # Which unfortunately makes the definition more complicated than it should be

+ # The condition should be reversed once /usr/bin/python is python3!

+ 

  %py_byte_compile()\

- python_binary="%1"\

- bytecode_compilation_path="%2"\

- find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\

+ py2_byte_compile () {\

+     python_binary="%1"\

+     bytecode_compilation_path="%2"\

+     find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\

+     find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\

+ }\

+ \

+ py3_byte_compile () {\

+     python_binary="%1"\

+     bytecode_compilation_path="%2"\

+     find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\

+ }\

+ \

+ [[ "%1" == *python3* ]] || py2_byte_compile "%1" "%2" && py3_byte_compile "%1" "%2" \

  %{nil}

file added
+64
@@ -0,0 +1,64 @@ 

+ # KNOWN BUGS:

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1489816

+ addFilter(r'crypto-policy-non-compliance-openssl')

+ 

+ 

+ # TESTS:

+ addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3.\d/test')

+ 

+ 

+ # OTHER DELIBERATES:

+ # chroot function

+ addFilter(r'missing-call-to-chdir-with-chroot')

+ 

+ # intentionally unversioned and selfobsoleted

+ addFilter(r'unversioned-explicit-obsoletes python')

+ addFilter(r'self-obsoletion python3\d obsoletes python3\d')

+ 

+ # intentionally hardcoded

+ addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})')

+ 

+ # we have non binary stuff, python files

+ addFilter(r'only-non-binary-in-usr-lib')

+ 

+ # some devel files that are deliberately needed

+ addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\dm/pyconfig-(32|64)\.h')

+ addFilter(r'devel-file-in-non-devel-package /usr/lib64/python3\.\d/distutils/tests/xxmodule\.c')

+ 

+ 

+ # SORRY, NOT SORRY:

+ # manual pages

+ addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3-debug|pathfix\.py)')

+ addFilter(r'no-manual-page-for-binary python3.*-config$')

+ addFilter(r'no-manual-page-for-binary python3.\dd?m$')

+ 

+ # missing documentation from subpackages

+ addFilter(r'^python3\d?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation')

+ 

+ # platform python is obsoleted, but not provided

+ addFilter(r'obsolete-not-provided platform-python')

+ 

+ 

+ # RPMLINT IMPERFECTIONS:

+ # ifarch applied patches are OK

+ # https://fedoraproject.org/wiki/Packaging:Guidelines#Architecture_Support

+ addFilter(r'%ifarch-applied-patch')

+ 

+ # debugsource

+ addFilter(r'^python3\d?-debugsource\.[^:]+: (E|W): no-documentation')

+ 

+ # debuginfo

+ addFilter(r'^python3\d?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)')

+ 

+ # debug package contains devel and non-devel files

+ addFilter(r'python3\d?-debug.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package')

+ 

+ # this goes to other subpackage, hence not actually dangling, the read error is bogus

+ addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc python-3\.\d\.pc')

+ addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc \[Errno 2\]')

+ 

+ # we need this macro to evaluate, even if the line starts with #

+ addFilter(r'macro-in-comment %\{_pyconfig(32|64)_h\}')

+ 

+ # SPELLING ERRORS

+ addFilter(r'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ')

file modified
+28 -23
@@ -124,8 +124,8 @@ 

  Name: python3

  #  WARNING  When rebasing to a new Python version,

  #           remember to update the python3-docs package as well

- Version: %{pybasever}.4

- Release: 3%{?dist}

+ Version: %{pybasever}.5

+ Release: 1%{?dist}

  License: Python

  Group: Development/Languages

  
@@ -410,24 +410,17 @@ 

  # Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918

  Patch262: 00262-pep538_coerce_legacy_c_locale.patch

  

- # 00264 #

- # test_pass_by_value was added in Python 3.6.1 and on aarch64

- # it is catching an error that was there, but wasn't tested before.

- # Therefore skipping the test on aarch64 until fixed upstream.

- # Reported upstream: http://bugs.python.org/issue29804

- Patch264: 00264-skip-test-failing-on-aarch64.patch

- 

  # 00292 #

  # Restore the public PyExc_RecursionErrorInst symbol that was removed

  # from the 3.6.4 release upstream.

  # Reported upstream: https://bugs.python.org/issue30697

  Patch292: 00292-restore-PyExc_RecursionErrorInst-symbol.patch

  

- # 00298 #

- # The SSL module no longer sends IP addresses in SNI TLS extension on

- # platforms with OpenSSL 1.0.2+ or inet_pton.

- # Fixed upstream: https://bugs.python.org/issue32185

- Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch

+ # 00301 #

+ # Tools/scripts/pathfix.py: Add -n option for no backup~

+ # See: https://bugzilla.redhat.com/show_bug.cgi?id=1546990

+ # Fixed upstream: https://bugs.python.org/issue32885

+ Patch301: 00301-pathfix-add-n-option-for-no-backup.patch

  

  # (New patches go here ^^^)

  #
@@ -661,7 +654,7 @@ 

  #done

  

  %if 0%{with_rewheel}

- %global pip_version 9.0.1

+ %global pip_version 9.0.3

  sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py

  %endif

  
@@ -700,13 +693,8 @@ 

  %patch206 -p1

  %patch243 -p1

  %patch262 -p1

- 

- %ifarch aarch64

- %patch264 -p1

- %endif

- 

  %patch292 -p1

- %patch298 -p1

+ %patch301 -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.
@@ -981,8 +969,9 @@ 

  # Switch all shebangs to refer to the specific Python version.

  LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \

    Tools/scripts/pathfix.py \

-   -i "%{_bindir}/python%{pybasever}" \

-   %{buildroot}

+   -i "%{_bindir}/python%{pybasever}" -pn \

+   %{buildroot} \

+   %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py}

  

  # Remove shebang lines from .py files that aren't executable, and

  # remove executability from .py files that don't have a shebang line:
@@ -1667,6 +1656,22 @@ 

  # ======================================================

  

  %changelog

+ * Thu Mar 29 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.6.5-1

+ - Update to 3.6.5

+ 

+ * Sat Mar 24 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.4-6

+ - Fix broken macro invocation and broken building of C Python extensions

+ Resolves: rhbz#1560103

+ 

+ * Fri Mar 16 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.4-5

+ - Add -n option for pathfix.py

+ Resolves: rhbz#1546990

+ 

+ * Thu Mar 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.4-4

+ - Fix the py_byte_compile macro to work on Python 2

+ - Remove the pybytecompile macro file from the flat package

+ Resolves: rhbz#1484993

+ 

  * Tue Mar 13 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.6.4-3

  - Do not send IP addresses in SNI TLS extension

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (Python-3.6.4.tar.xz) = 09ba2103ac517ac4d262f00380c9aac836a53401ce252540c17fd821a3b92e1ddf32528d00772221eb3126b12cb95b62c3ac3e852f4951e6f2eb406c88c848a2

+ SHA512 (Python-3.6.5.tar.xz) = 6b26fcd296b9bd8e67861eff10d14db7507711ddba947288d16d6def53135c39326b7f969c04bb2b2993f924d9e7ad3f5c5282a3915760bc0885cf0a8ea5eb51

Also additional fixes from master.

Please add https://src.fedoraproject.org/rpms/python37/c/5fba9f866840db9255dbbde2d472ba104faec627?branch=f27

So if I understand correctly this is required only for F26 and F27 branches?

9 new commits added

  • Update to 3.6.5
  • Fix shebangs of the GDB hooks
  • rpmlintrc: Filter macro-in-comment %{_pyconfig(32|64)_h}
  • Fix broken macro invocation and broken building of C Python extensions
  • rpmlintrc: Do not filter library-without-ldconfig-post on F < 28
  • Add rpmlintrc file
  • Use %% for actual % in spec
  • Add -n option for pathfix.py (#1546990)
  • Fix the py_byte_compile macro to work on Python 2
6 years ago

Pull-Request has been merged by cstratak

6 years ago