Skip to content

gh-143474: Add os.RWF_ATOMIC constant#143475

Merged
ZeroIntensity merged 1 commit into
python:mainfrom
claydugo:gh-143474-rwf-atomic
Jan 6, 2026
Merged

gh-143474: Add os.RWF_ATOMIC constant#143475
ZeroIntensity merged 1 commit into
python:mainfrom
claydugo:gh-143474-rwf-atomic

Conversation

@claydugo

@claydugo claydugo commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

@python-cla-bot

python-cla-bot Bot commented Jan 6, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Comment thread Doc/library/os.rst Outdated
@claydugo claydugo force-pushed the gh-143474-rwf-atomic branch from 05b03ad to 90be11b Compare January 6, 2026 13:21
Comment thread Modules/posixmodule.c
- RWF_SYNC
- RWF_APPEND
- RWF_DONTCACHE
- RWF_ATOMIC

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i work with clay and he has been keeping me updated on the discussion thx all)

May I suggest we follow the order from
https://github.com/torvalds/linux/blob/7f98ab9da046865d57c102fd3ca9669a29845f67/include/uapi/linux/fs.h#L429

these low level flags are pretty tricky to get right, and to validate, keeping the order the "same" helps triple check things.

Excited that this is getting a revival!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can consider that for a follow-up PR. I think it's important to keep the blame intact here, so when Linux goes and adds new flags, we can quickly look up the precedent for adding them.

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZeroIntensity

Copy link
Copy Markdown
Member

I'm going to merge this. It's intentional that this doesn't have a "What's New" entry, since one wasn't added for RWF_DONTCACHE either (#139090). If anyone disagrees, please submit a follow-up PR containing an entry for both RWF_DONTCACHE and RFC_ATOMIC and tag me for a review.

@ZeroIntensity ZeroIntensity merged commit d745b60 into python:main Jan 6, 2026
87 of 89 checks passed
@hmaarrfk

hmaarrfk commented Jan 6, 2026

Copy link
Copy Markdown

Very cool. Thanks!

thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
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