commit python-subprocess32 for openSUSE:Factory
Hello community, here is the log from the commit of package python-subprocess32 for openSUSE:Factory checked in at 2019-05-28 09:41:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-subprocess32 (Old) and /work/SRC/openSUSE:Factory/.python-subprocess32.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-subprocess32" Tue May 28 09:41:43 2019 rev:5 rq:705298 version:3.5.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-subprocess32/python-subprocess32.changes 2019-01-15 09:13:04.766419040 +0100 +++ /work/SRC/openSUSE:Factory/.python-subprocess32.new.5148/python-subprocess32.changes 2019-05-28 09:41:44.949875770 +0200 @@ -1,0 +2,9 @@ +Fri May 24 19:34:16 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> + +- Update to 3.5.4: + * TimeoutExpired and CalledProcessError exceptions can now + be unpickled. + * Backport the fixes for https://bugs.python.org/issue10963, + https://bugs.python.org/issue19612, and https://bugs.python.org/issue30418. + +------------------------------------------------------------------- Old: ---- subprocess32-3.5.3.tar.gz New: ---- subprocess32-3.5.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-subprocess32.spec ++++++ --- /var/tmp/diff_new_pack.of5qVJ/_old 2019-05-28 09:41:45.817875469 +0200 +++ /var/tmp/diff_new_pack.of5qVJ/_new 2019-05-28 09:41:45.817875469 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-subprocess32 # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -20,7 +20,7 @@ # Note: this package is python 2.x-only. %define skip_python3 1 Name: python-subprocess32 -Version: 3.5.3 +Version: 3.5.4 Release: 0 Summary: A backport of the subprocess module from Python 3.2/3.3 for use on 2.x License: Python-2.0 @@ -29,10 +29,10 @@ Source: https://files.pythonhosted.org/packages/source/s/subprocess32/subprocess32-%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros %if 0%{?rhel} || 0%{?fedora} BuildRequires: python-test %endif -BuildRequires: python-rpm-macros %python_subpackages %description ++++++ subprocess32-3.5.3.tar.gz -> subprocess32-3.5.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/ChangeLog new/subprocess32-3.5.4/ChangeLog --- old/subprocess32-3.5.3/ChangeLog 2018-10-10 00:12:07.000000000 +0200 +++ new/subprocess32-3.5.4/ChangeLog 2019-05-21 00:08:37.000000000 +0200 @@ -1,7 +1,28 @@ ----------------- +2019-05-20 3.5.4 +----------------- + * Promoted 3.5.4rc2 to become 3.5.4. + +----------------- +2019-05-13 3.5.4rc2 +----------------- + * GitHub [#57]: TimeoutExpired and CalledProcessError exceptions can now + be unpickled. + +----------------- +2019-05-10 3.5.4rc1 +----------------- +* GitHub [#61]: Backport the fixes for https://bugs.python.org/issue10963, + https://bugs.python.org/issue19612, and https://bugs.python.org/issue30418. + When a child process was so short lived it dies or closes its pipes before + you call communicate(). When supplying stdin or reading its output in + this scenario, do not raise an unexpected broken pipe or interrupted + system call exception. + +----------------- 2018-10-09 3.5.3 ----------------- -* Disallow rediculiously large numbers (millions) of arguments. [#54] +* Disallow ridiculously large numbers (millions) of arguments. [#54] ----------------- 2018-06-07 3.5.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/PKG-INFO new/subprocess32-3.5.4/PKG-INFO --- old/subprocess32-3.5.3/PKG-INFO 2018-10-10 00:13:43.000000000 +0200 +++ new/subprocess32-3.5.4/PKG-INFO 2019-05-21 00:10:13.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: subprocess32 -Version: 3.5.3 +Version: 3.5.4 Summary: A backport of the subprocess module from Python 3 for use on 2.x. Home-page: https://github.com/google/python-subprocess32 Maintainer: Gregory P. Smith diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/setup.py new/subprocess32-3.5.4/setup.py --- old/subprocess32-3.5.3/setup.py 2018-10-10 00:12:07.000000000 +0200 +++ new/subprocess32-3.5.4/setup.py 2019-05-21 00:08:37.000000000 +0200 @@ -66,7 +66,7 @@ setup( name='subprocess32', - version='3.5.3', + version='3.5.4', description='A backport of the subprocess module from Python 3 for use on 2.x.', long_description="""\ This is a backport of the subprocess standard library module from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/subprocess32.egg-info/PKG-INFO new/subprocess32-3.5.4/subprocess32.egg-info/PKG-INFO --- old/subprocess32-3.5.3/subprocess32.egg-info/PKG-INFO 2018-10-10 00:13:43.000000000 +0200 +++ new/subprocess32-3.5.4/subprocess32.egg-info/PKG-INFO 2019-05-21 00:10:13.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: subprocess32 -Version: 3.5.3 +Version: 3.5.4 Summary: A backport of the subprocess module from Python 3 for use on 2.x. Home-page: https://github.com/google/python-subprocess32 Maintainer: Gregory P. Smith diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/subprocess32.py new/subprocess32-3.5.4/subprocess32.py --- old/subprocess32-3.5.3/subprocess32.py 2018-10-10 00:12:07.000000000 +0200 +++ new/subprocess32-3.5.4/subprocess32.py 2019-05-21 00:08:37.000000000 +0200 @@ -41,6 +41,7 @@ mswindows = (sys.platform == "win32") import os +import errno import exceptions import types import time @@ -64,6 +65,8 @@ self.cmd = cmd self.output = output self.stderr = stderr + super(CalledProcessError, self).__init__(returncode, cmd, + output, stderr) def __str__(self): if self.returncode and self.returncode < 0: @@ -99,6 +102,7 @@ self.timeout = timeout self.output = output self.stderr = stderr + super(TimeoutExpired, self).__init__(cmd, timeout, output, stderr) def __str__(self): return ("Command '%s' timed out after %s seconds" % @@ -132,7 +136,6 @@ else: import select _has_poll = hasattr(select, 'poll') - import errno import fcntl import pickle @@ -682,6 +685,29 @@ self._devnull = os.open(os.devnull, os.O_RDWR) return self._devnull + def _stdin_write(self, input): + if input: + try: + self.stdin.write(input) + except EnvironmentError as e: + if e.errno == errno.EPIPE: + # communicate() must ignore broken pipe error + pass + elif e.errno == errno.EINVAL : + # bpo-19612, bpo-30418: On Windows, stdin.write() fails + # with EINVAL if the child process exited or if the child + # process is still running but closed the pipe. + pass + else: + raise + + try: + self.stdin.close() + except EnvironmentError as e: + if e.errno in (errno.EPIPE, errno.EINVAL): + pass + else: + raise def communicate(self, input=None, timeout=None): """Interact with process: Send data to stdin. Read data from @@ -708,9 +734,7 @@ stdout = None stderr = None if self.stdin: - if input: - self.stdin.write(input) - self.stdin.close() + self._stdin_write(input) elif self.stdout: stdout = _eintr_retry_call(self.stdout.read) self.stdout.close() @@ -983,9 +1007,7 @@ self.stderr_thread.start() if self.stdin: - if input is not None: - self.stdin.write(input) - self.stdin.close() + self._stdin_write(input) # Wait for the reader threads, or time out. If we time out, the # threads remain reading and the fds left open in case the user @@ -1681,11 +1703,19 @@ if self.stdin in wlist: chunk = self._input[self._input_offset : self._input_offset + _PIPE_BUF] - bytes_written = os.write(self.stdin.fileno(), chunk) - self._input_offset += bytes_written - if self._input_offset >= len(self._input): - self.stdin.close() - self._write_set.remove(self.stdin) + try: + bytes_written = os.write(self.stdin.fileno(), chunk) + except EnvironmentError as e: + if e.errno == errno.EPIPE: + self._write_set.remove(self.stdin) + self.stdin.close() + else: + raise + else: + self._input_offset += bytes_written + if self._input_offset >= len(self._input): + self.stdin.close() + self._write_set.remove(self.stdin) if self.stdout in rlist: data = os.read(self.stdout.fileno(), 1024) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subprocess32-3.5.3/test_subprocess32.py new/subprocess32-3.5.4/test_subprocess32.py --- old/subprocess32-3.5.3/test_subprocess32.py 2018-10-10 00:12:07.000000000 +0200 +++ new/subprocess32-3.5.4/test_subprocess32.py 2019-05-21 00:08:37.000000000 +0200 @@ -27,6 +27,7 @@ import gc except ImportError: gc = None +import pickle mswindows = (sys.platform == "win32") @@ -999,6 +1000,25 @@ output = subprocess.check_output([sys.executable, '-c', code]) self.assert_(output.startswith('Hello World!'), output) + def test_communicate_epipe(self): + # Issue 10963: communicate() should hide EPIPE + p = subprocess.Popen([sys.executable, "-c", 'pass'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + self.addCleanup(p.stdout.close) + self.addCleanup(p.stderr.close) + self.addCleanup(p.stdin.close) + p.communicate(b"x" * 2**20) + + def test_communicate_epipe_only_stdin(self): + # Issue 10963: communicate() should hide EPIPE + p = subprocess.Popen([sys.executable, "-c", 'pass'], + stdin=subprocess.PIPE) + self.addCleanup(p.stdin.close) + p.wait() + p.communicate(b"x" * 2**20) + if not mswindows: # Signal tests are POSIX specific. def test_communicate_eintr(self): # Issue #12493: communicate() should handle EINTR @@ -2340,6 +2360,28 @@ args_list = subprocess32._args_from_interpreter_flags() self.assertTrue(isinstance(args_list, list), msg=repr(args_list)) + def test_timeout_expired_unpickling(self): + """https://github.com/google/python-subprocess32/issues/57""" + t = subprocess32.TimeoutExpired(['command', 'arg1'], 5, + output='stdout!', stderr='err') + t_pickled = pickle.dumps(t) + t2 = pickle.loads(t_pickled) + self.assertEqual(t.cmd, t2.cmd) + self.assertEqual(t.timeout, t2.timeout) + self.assertEqual(t.output, t2.output) + self.assertEqual(t.stderr, t2.stderr) + + def test_called_process_error_unpickling(self): + """https://github.com/google/python-subprocess32/issues/57""" + e = subprocess32.CalledProcessError( + 2, ['command', 'arg1'], output='stdout!', stderr='err') + e_pickled = pickle.dumps(e) + e2 = pickle.loads(e_pickled) + self.assertEqual(e.returncode, e2.returncode) + self.assertEqual(e.cmd, e2.cmd) + self.assertEqual(e.output, e2.output) + self.assertEqual(e.stderr, e2.stderr) + def reap_children(): """Use this function at the end of test_main() whenever sub-processes
participants (1)
-
root