]> granicus.if.org Git - python/commitdiff
Remove the subprocess "bad exception data" warning (formerly a print!)
authorGregory P. Smith <greg@krypto.org>
Sun, 11 Nov 2012 08:04:13 +0000 (00:04 -0800)
committerGregory P. Smith <greg@krypto.org>
Sun, 11 Nov 2012 08:04:13 +0000 (00:04 -0800)
all together and just include the repr of the data in the exception
itself instead of the useless string "Unknown".

This code path is unlikely to even be possible to take given the
nature of the pipe it gets subprocess data from.

Lib/subprocess.py
Misc/NEWS

index 18e9ed73a8732758b868ff06cefcb5bc672c4396..fcc3e6e3baaa524d1d3d6888575613719e7431f9 100644 (file)
@@ -1371,11 +1371,10 @@ class Popen(object):
                     exception_name, hex_errno, err_msg = (
                             errpipe_data.split(b':', 2))
                 except ValueError:
-                    warnings.warn(RuntimeWarning(
-                            'Bad exception data: %r' % errpipe_data))
                     exception_name = b'RuntimeError'
                     hex_errno = b'0'
-                    err_msg = b'Unknown'
+                    err_msg = (b'Bad exception data from child: ' +
+                               repr(errpipe_data))
                 child_exception_type = getattr(
                         builtins, exception_name.decode('ascii'),
                         RuntimeError)
index 16bfb3019b837ab917812803b8501ec6affe71c9..49d6a1a386666ef23d9f39f4660bd264ecaf545a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -162,6 +162,9 @@ Core and Builtins
 Library
 -------
 
+- Remove a bare print to stdout from the subprocess module that could have
+  happened if the child process wrote garbage to its pre-exec error pipe.
+
 - Issue #16327: The subprocess module no longer leaks file descriptors
   used for stdin/stdout/stderr pipes to the child when fork() fails.