[Python-bugs-list] [ python-Bugs-496171 ] FD_CLOEXEC no longer available

noreply@sourceforge.net noreply@sourceforge.net
Sun, 23 Dec 2001 02:27:09 -0800


Bugs item #496171, was opened at 2001-12-22 13:33
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496171&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 7
Submitted By: Per Cederqvist (ceder)
Assigned to: Barry Warsaw (bwarsaw)
Summary: FD_CLOEXEC no longer available

Initial Comment:
In at least Python 1.6 through 2.1, the FD_CLOEXEC
constant was available as FCNTL.FD_CLOEXEC.  Starting
with Python 2.2, the constant isn't available from
any module, as far as I (and grep) can tell.  The
fsh project (http://www.lysator.liu.se/fsh) needs
access to the FD_CLOEXEC flag.

----------------------------------------------------------------------

>Comment By: Per Cederqvist (ceder)
Date: 2001-12-23 02:27

Message:
Logged In: YES 
user_id=129207

It's been a hectic autumn. On december 21st, I finally
got time to test the Python 2.2c1 beta. I found that there
was a problem with fsh, but didn't have time to find out
what the problem was.  Hours later, the news reached me
that Python 2.2 final was released.  Bad timing, I guess.

It turns out that FD_CLOEXEC is set to 1 on every platform
in the known universe (including AIX), so I can work around
the problem.  My code won't look pretty, though:

   Use fcntl.FD_CLOEXEC, if available.
   Otherwise, use FCNTL.FD_CLOEXEC, if available, but
   make sure to turn off the warnings for importing
   FCNTL (if the warnings module is available).
   Otherwise, use 1.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-12-22 16:24

Message:
Logged In: YES 
user_id=31435

Assigned to Barry because he's working this week <wink>.

Digging thru the mass of old FCNTL.py files in the Lib/plat-
xxx/ Attics, it looks to me like the current fcntlmodule is 
missing oodles of symbols that used to be available, some 
that were defined on most platforms (like FD_CLOEXEC), and 
many platform-unique.  We should probably try the union of 
all of them in fcntlmodule.c.

Per, sorry, looks like you'll have to wait for 2.2.1 
(assuming a bugfix release manager volunteers to produce 
one).  For 2.3, how about trying one of the beta releases 
before it's too late?  Thousands of people downloaded the 
2.2 betas, but I'm afraid nobody noticed the FD_CLOEXEC 
disappearance.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496171&group_id=5470