Skip to content

Conversation

@miss-islington
Copy link
Contributor

RDM: per AZero13's research the 'x' option did not exist when this code was written, This
modernization can thus drop the fd trick in _create_carefully and just use open with 'x' to achieve the same goal more securely.
(cherry picked from commit a88d1b8)

Co-authored-by: AZero13 gfunni234@gmail.com
Co-authored-by: sobolevn mail@sobolevn.me

…thonGH-143011)

* pythongh-143010: Prevent a TOCTOU issue by pythongh-143010: Prevent a TOCTOU issue by only calling open once

RDM: per  AZero13's research the 'x' option did not exist when this code was written,  This
modernization can thus drop the fd trick in _create_carefully and just use open with 'x' to achieve the same goal more securely.
(cherry picked from commit a88d1b8)

Co-authored-by: AZero13 <gfunni234@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
@miss-islington miss-islington requested a review from a team as a code owner December 22, 2025 17:48
@bitdancer bitdancer merged commit a6cfdb5 into python:3.13 Dec 22, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants