KEMBAR78
gh-83714: Set os.statx().stx_mode to None if missing from stx_mask by vstinner · Pull Request #140484 · python/cpython · GitHub
Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 22, 2025

  • Set stx_mode to None if STATX_TYPE|STATX_MODE is missing from stx_mask.
  • Enhance os.statx() tests.
  • statx_result structure: remove atime_sec, btime_sec, ctime_sec and mtime_sec members. Compute them on demand when stx_atime, stx_btime, stx_ctime and stx_mtime are read.
  • Doc: fix statx members sorting.

📚 Documentation preview 📚: https://cpython-previews--140484.org.readthedocs.build/

* Set stx_mode to None if STATX_TYPE|STATX_MODE is missing from
  stx_mask.
* Enhance os.statx() tests.
* statx_result structure: remove atime_sec, btime_sec, ctime_sec and
  mtime_sec members. Compute them on demand when stx_atime,
  stx_btime, stx_ctime and stx_mtime are read.
* Doc: fix statx members sorting.
@vstinner
Copy link
Member Author

Another "cleanup" PR for os.statx().

statx_result structure: remove atime_sec, btime_sec, ctime_sec and mtime_sec members. Compute them on demand when stx_atime, stx_btime, stx_ctime and stx_mtime are read.

This might speedup os.statx() calls when these members are not read.

cc @cmaloney @jbosboom

Note for myeslf: This PR should be tested on buildbots before being merged.

@vstinner vstinner added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 22, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @vstinner for commit f627fcb 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F140484%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 22, 2025
@vstinner
Copy link
Member Author

ARM Raspbian Linux Asan PR: test_urllib2net failed (FTP), it's unrelated.

@vstinner
Copy link
Member Author

AMD64 Arch Linux buildbots also failed with test_urllib2net.

@vstinner vstinner merged commit 5d2edf7 into python:main Oct 23, 2025
115 of 121 checks passed
@vstinner vstinner deleted the stx_mode branch October 23, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants