mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
Issue #16860: In tempfile, use O_CLOEXEC when available to set the
close-on-exec flag atomically.
This commit is contained in:
parent
4e02538bf3
commit
b9a76e2920
2 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,8 @@ except ImportError:
|
||||||
_allocate_lock = _thread.allocate_lock
|
_allocate_lock = _thread.allocate_lock
|
||||||
|
|
||||||
_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
|
_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
|
||||||
|
if hasattr(_os, 'O_CLOEXEC'):
|
||||||
|
_text_openflags |= _os.O_CLOEXEC
|
||||||
if hasattr(_os, 'O_NOINHERIT'):
|
if hasattr(_os, 'O_NOINHERIT'):
|
||||||
_text_openflags |= _os.O_NOINHERIT
|
_text_openflags |= _os.O_NOINHERIT
|
||||||
if hasattr(_os, 'O_NOFOLLOW'):
|
if hasattr(_os, 'O_NOFOLLOW'):
|
||||||
|
|
|
@ -204,6 +204,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #16860: In tempfile, use O_CLOEXEC when available to set the
|
||||||
|
close-on-exec flag atomically.
|
||||||
|
|
||||||
- Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
|
- Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
|
||||||
|
|
||||||
- Issue #16009: JSON error messages now provide more information.
|
- Issue #16009: JSON error messages now provide more information.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue