From: Gregory P. Smith Date: Mon, 4 Aug 2008 03:23:25 +0000 (+0000) Subject: (backport from trunk r64756) X-Git-Tag: v2.5.3c1~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7641b1c94352b69318c301ab55fa408207092289;p=thirdparty%2FPython%2Fcpython.git (backport from trunk r64756) Issue #2113: Fix error in subprocess.Popen if the select system call is interrupted by a signal. --- diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 046f80ca6f88..80be0873301c 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1153,7 +1153,12 @@ class Popen(object): input_offset = 0 while read_set or write_set: - rlist, wlist, xlist = select.select(read_set, write_set, []) + try: + rlist, wlist, xlist = select.select(read_set, write_set, []) + except select.error, e: + if e.args[0] == errno.EINTR: + continue + raise if self.stdin in wlist: # When select has indicated that the file is writable, diff --git a/Misc/NEWS b/Misc/NEWS index 603e84711ebf..47cb3ef110a0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -130,6 +130,10 @@ Library argument in python 2.5, this broke code that subclassed Popen to include its own poll method. Fixed my moving _deadstate to an _internal_poll method. +- Issue #2113: Fix error in subprocess.Popen if the select system call is + interrupted by a signal. + + Extension Modules -----------------