Visitar URL original
Add os.supports_dir_fd to test.pythoninfo by encukou · Pull Request #158605 · python/cpython · GitHub
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.

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.

3 participants