cpython: 8e3d412f8e89 (original) (raw)

Mercurial > cpython

changeset 106279:8e3d412f8e89 2.7

Issue #29335: Fix subprocess.Popen.wait() when the child process has exited to a stopped instead of terminated state (ex: when under ptrace). [#29335]

Gregory P. Smith greg@krypto.org
date Sun, 22 Jan 2017 22:38:28 -0800
parents 9b22d52a6d4b
children fb2885f9b4dd
files Lib/subprocess.py Lib/test/test_subprocess.py Misc/NEWS
diffstat 3 files changed, 53 insertions(+), 1 deletions(-)[+] [-] Lib/subprocess.py 5 Lib/test/test_subprocess.py 46 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1026,13 +1026,16 @@ class Popen(object): def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED, _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,

--- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2,6 +2,7 @@ import unittest from test import test_support import subprocess import sys +import platform import signal import os import errno @@ -11,6 +12,11 @@ import re import sysconfig try:

+except ImportError:

+ +try: import resource except ImportError: resource = None @@ -1216,6 +1222,46 @@ class POSIXProcessTestCase(BaseTestCase) self.assertEqual(p2.returncode, 0, "Unexpected error: " + repr(stderr))

+ @unittest.skipUnless(mswindows, "Windows specific tests") class Win32ProcessTestCase(BaseTestCase):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,6 +23,9 @@ Extension Modules Library ------- +- Issue #29335: Fix subprocess.Popen.wait() when the child process has