New submission from Dave Abrahams <d...@boostpro.com>: Try the following script on posix and Windows. On Posix:
launched . . . exiting killed on Windows: launched . . . exiting Traceback (most recent call last): File "sp.py", line 16, in <module> p.terminate() File "c:\Python26\lib\subprocess.py", line 949, in terminate _subprocess.TerminateProcess(self._handle, 1) WindowsError: [Error 5] Access is denied This inconsistency seems unnecessary and is an obstacle to writing portable code. from subprocess import * import sys, time p = Popen([sys.executable, '-c', ''' import time, sys for i in range(3): time.sleep(.3) print '.', sys.stdout.flush() print 'exiting' '''], stdout = sys.stdout, stderr = sys.stderr) print 'launched' time.sleep(2) p.terminate() print 'killed' ---------- components: Library (Lib) messages: 155391 nosy: dabrahams priority: normal severity: normal status: open title: subprocess.Popen.terminate() inconsistent behavior on Windows versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14252> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com