Message166242
A program which depends on the old behaviour would be broken on a non-refcounted implementation of Python, so I would be inclined to say "won't fix". However, I think the following patch would restore the old behaviour diff -r a970054a93fb Lib/os.py --- a/Lib/os.py Mon Jul 16 18:30:03 2012 +0100 +++ b/Lib/os.py Mon Jul 23 19:12:38 2012 +0100 @@ -1004,6 +1004,13 @@ # Helper for popen() -- a proxy for a file whose close waits for the process class _wrap_close: def __init__(self, stream, proc): + # proc should be waited on when stream is garbage collected + import weakref + def callback(wr): + proc._weakref = None # break ref cycle + proc.wait() + proc._weakref = weakref.ref(stream, callback) + proc.stdin = proc.stdout = None # proc must not keep stream alive self._stream = stream self._proc = proc def close(self): | |
| Date | User | Action | Args | | 2012-07-23 18:20:41 | sbt | set | recipients: + sbt, doerwalter | | 2012-07-23 18:20:41 | sbt | set | messageid: <1343067641.07.0.697106944777.issue15408@psf.upfronthosting.co.za> | | 2012-07-23 18:20:40 | sbt | link | issue15408 messages | | 2012-07-23 18:20:40 | sbt | create | | |