[New-bugs-announce] [issue22258] Use FD_CLOEXEC in Python/fileutils.c

Igor Pashev report at bugs.python.org
Sat Aug 23 15:20:24 CEST 2014

New submission from Igor Pashev:

I've found on illumos-based OS that under some conditions python is unable to open any files because set_inheritable() fails. This happens even when building python when it cannot find (open) _sysconfigdata.py.

The problem is that set_inheritable() first checks for FIOCLEX/FIONCLEX ioctls and tries to use them if such macros are defined. These macros can be defined at illumos, but kernel does not support them (inappropriate ioctl). Since other pieces of python already use FD_CLOEXEC unconditionally, including get_inheritable() I patched set_inheritable() to use FD_CLOEXEC. See attached patch.

components: Build, IO
files: dyson-set_inheritable.patch
keywords: patch
messages: 225745
nosy: igor.pashev
priority: normal
severity: normal
status: open
title: Use FD_CLOEXEC in Python/fileutils.c
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file36443/dyson-set_inheritable.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list