Skip to content

Add os.supports_dir_fd to test.pythoninfo - #158605

Merged
encukou merged 1 commit into
python:mainfrom
encukou:pythoninfo-os-supports
Oct 8, 2026
Merged

encukou merged 1 commit into
python:mainfrom
encukou:pythoninfo-os-supports

Conversation

@encukou

@encukou encukou commented Oct 2, 2026

Copy link
Copy Markdown
Member

I looked for os.supports_dir_fd this when investigating the 3.13 Android failure on GH-158429, and realized we don't show it yet.
(So I need this and #146410 backported to 3.13, but, this PR should be useful even if that doesn't happen.)

  • Split the attribute lists so the 'supports_*' names don't need to be repeated twice.

  • Add 'supports_dir_fd'.

Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
@encukou
encukou requested a review from vstinner October 2, 2026 15:30
@encukou encukou added type-feature A feature request or enhancement tests Tests in the Lib/test dir needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Oct 2, 2026

@vstinner vstinner 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.

The variables are formatted/logged properly:

$ ./python -m test.pythoninfo|grep -E '^os\.(supports|name|supports_bytes_environ)'
os.name: posix
os.supports_bytes_environ: True
os.supports_dir_fd: ['access', 'chmod', 'chown', 'link', 'lstat', 'mkdir', 'mkfifo', 'mknod', 'open', 'readlink', 'rename', 'rmdir', 'stat', 'statx', 'symlink', 'unlink', 'utime']
os.supports_effective_ids: ['access']
os.supports_fd: ['chdir', 'chmod', 'chown', 'execve', 'listdir', 'pathconf', 'scandir', 'stat', 'statvfs', 'statx', 'truncate', 'utime']
os.supports_follow_symlinks: ['access', 'chown', 'link', 'stat', 'statx', 'utime']

@encukou
encukou merged commit eb77b4b into python:main Oct 8, 2026
58 of 66 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 8, 2026

Copy link
Copy Markdown

GH-159023 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Oct 8, 2026
@bedevere-app

bedevere-app Bot commented Oct 8, 2026

Copy link
Copy Markdown

GH-159024 is a backport of this pull request to the 3.14 branch.

@miss-islington-app

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 9, 2026

Copy link
Copy Markdown

GH-159059 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 9, 2026
Yhg1s pushed a commit that referenced this pull request Oct 9, 2026
Add os.supports_dir_fd to test.pythoninfo (GH-158605)

Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
(cherry picked from commit eb77b4b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
@encukou encukou added the needs backport to 3.14 bugs and security fixes label Oct 9, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 9, 2026
Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
(cherry picked from commit eb77b4b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
@encukou encukou removed the needs backport to 3.14 bugs and security fixes label Oct 9, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry @encukou, I had trouble completing the backport.

Please retry by removing and re-adding the "needs backport to 3.14" label.
If that does not work, please backport manually with cherry_picker, see the devguide for more information.

cherry_picker eb77b4b2e4180b779e3d4c7d42c6a47ba965f74b 3.14

serhiy-storchaka pushed a commit that referenced this pull request Oct 10, 2026
Add os.supports_dir_fd to test.pythoninfo (GH-158605)

Split the attribute lists so the 'supports_*' names don't need
to be repeated twice.

Add 'supports_dir_fd'.
(cherry picked from commit eb77b4b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants