This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author astrand
Recipients
Date 2004-10-20.13:06:56
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=344921

>>> import os
>>> os.dup(0)
5

I think this is the core of the problem. The test_close_fds
test works like this:

All file descriptors in the forked child (except 0,1,2) are
closed. Then the Python binary is executed via execvp(). A
small test program is passed to the Python binary via the -c
command line option. If the OS and subprocess module works
correctly, we can be sure of that by the time of the
execve() system call, only file descriptors (0,1,2) are open
(well, the errpipe as well, but let's leave that out for
now). But, by the time the Python binary starts executing
the small program, all sorts of things may have happened.
I'm not really sure we can trust Python not to open files
during startup. For example, if we have a PYTHONSTARTUP
file, that open file will have a file descriptor, perhaps 3. 

On one hand, this bug could indicate a bug in the Python
interpreter itself: perhaps a file descriptor leak. On the
other hand, this test might be a bit too unsafe. 

So probably, this test should be removed. 
History
Date User Action Args
2007-08-23 14:26:44adminlinkissue1048808 messages
2007-08-23 14:26:44admincreate