changeset: 101445:4c02b983bd5f user: Victor Stinner date: Fri May 20 12:08:12 2016 +0200 files: Lib/subprocess.py description: Issue #26741: POSIX implementation of subprocess.Popen._execute_child() now sets the returncode attribute using the child process exit status when exec failed. diff -r b122011b139e -r 4c02b983bd5f Lib/subprocess.py --- a/Lib/subprocess.py Fri May 20 12:43:15 2016 +0200 +++ b/Lib/subprocess.py Fri May 20 12:08:12 2016 +0200 @@ -1524,9 +1524,14 @@ if errpipe_data: try: - os.waitpid(self.pid, 0) + pid, sts = os.waitpid(self.pid, 0) + if pid == self.pid: + self._handle_exitstatus(sts) + else: + self.returncode = sys.maxsize except ChildProcessError: pass + try: exception_name, hex_errno, err_msg = ( errpipe_data.split(b':', 2))