[Python-bugs-list] [ python-Bugs-803610 ] os.close(3) raises
OSError: [Errno 9] Bad file descriptor
SourceForge.net
noreply at sourceforge.net
Wed Sep 10 10:57:52 EDT 2003
Bugs item #803610, was opened at 2003-09-10 08:18
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=803610&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Syrah (syrah)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.close(3) raises OSError: [Errno 9] Bad file descriptor
Initial Comment:
os.close(3) raises OSError: Bad file descriptor on
FreeBSD 5.1, with both Python 2.2.2(_2) and 2.3(_1).
Python 2.3 on Gentoo Linux 1.4 is not affected.
Interestingly, if you call os.fstat(3) first, a
subsequent call to os.close(3) succeeds.
And yes, you do need to set up fd #3.
Here is a demonstration (on FreeBSD):
[syrah at ripple filter]$ cat test.py
import os
os.close (3)
[syrah at ripple filter]$ python test.py 3> file
Traceback (most recent call last):
File "test.py", line 2, in ?
os.close (3)
OSError: [Errno 9] Bad file descriptor
[syrah at ripple filter]$ cat test2.py
import os
os.fstat (3)
os.close (3)
[syrah at ripple filter]$ python test2.py 3> file
[syrah at ripple filter]$ (success!)
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2003-09-10 18:57
Message:
Logged In: YES
user_id=21627
Why is this a bug? 3 *is* a bad file descriptor, on the
systems which report it to be a bad file descriptor.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=803610&group_id=5470
More information about the Python-bugs-list
mailing list