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.

classification
Title: FD_CLOEXEC no longer available
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, ceder, loewis, tim.peters
Priority: normal Keywords:

Created on 2001-12-22 21:33 by ceder, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (4)
msg8453 - (view) Author: Per Cederqvist (ceder) Date: 2001-12-22 21:33
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.
msg8454 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-12-23 00:24
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.
msg8455 - (view) Author: Per Cederqvist (ceder) Date: 2001-12-23 10:27
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.
msg8456 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001-12-28 21:10
Logged In: YES 
user_id=21627

I've added this and other constants as fcntl.h 2.32 and
2.31.18.1 (release22-maint).
History
Date User Action Args
2022-04-10 16:04:49adminsetgithub: 35819
2001-12-22 21:33:32cedercreate