Skip to content

Add os.supports_dir_fd to test.pythoninfo - #158605

Open
encukou wants to merge 1 commit into
python:mainfrom
encukou:pythoninfo-os-supports
Open

encukou wants to merge 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']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes 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