Message61018
Given the following code:
import os
child_stdin = os.popen("cat -", "w")
old_stdout = os.dup(1)
os.close(child_stdin.fileno())
print "foo"
os.dup2(old_stdout, 1)
os.close(old_stdout)
I got these different results depending on the version
of python I am using.
$ python2.4 -V
Python 2.4.4c0
$ python2.4 test.py
foo
close failed: [Errno 9] Bad file descriptor
$ python2.3 -V
Python 2.3.5
$ python2.3 test/new/test.py
foo
My .02$ guess is that underlying file descriptor of
child_stdin being closed, when trying to delete this
object, it tries again to close it.
|
|
Date |
User |
Action |
Args |
2008-01-20 09:59:03 | admin | link | issue1574310 messages |
2008-01-20 09:59:03 | admin | create | |
|