[issue12105] open() does not able to set flags, such as O_CLOEXEC

Amaury Forgeot d'Arc report at bugs.python.org
Tue Nov 1 09:33:02 CET 2011


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

And to be explicit, you can now write:

def open_cloexex(filename, mode='r'):
  return open(filename, mode,
              opener=lambda path, mod: os.open(path, mod|os.O_CLOEXEC))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12105>
_______________________________________


More information about the Python-bugs-list mailing list