Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144050: Fix stat.filemode pure Python file type detection#144059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
serhiy-storchaka merged 4 commits intopython:mainfromVanshAgarwal24036:gh-144050
Jan 20, 2026

Conversation

@VanshAgarwal24036
Copy link
Contributor

@VanshAgarwal24036VanshAgarwal24036 commentedJan 20, 2026
edited by bedevere-appbot
Loading

This PR fixes a discrepancy between the C and pure Python implementations
of stat.filemode.

The pure Python implementation could misclassify arbitrary bit patterns
(e.g. 32767) as block devices. File type detection now correctly uses
(mode & S_IFMT) for file types, matching the C implementation.

A regression test is added to prevent this issue from recurring.

Fixes#144050

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Please add a NEWS entry.

…kKFbF.rstCo-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@serhiy-storchakaserhiy-storchaka merged commitfe62926 intopython:mainJan 20, 2026
51 checks passed
@VanshAgarwal24036VanshAgarwal24036 deleted the gh-144050 branchJanuary 20, 2026 12:11
@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJan 20, 2026
@miss-islington-app
Copy link

Thanks@VanshAgarwal24036 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks@VanshAgarwal24036 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 20, 2026
…ythonGH-144059)(cherry picked from commitfe62926)Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 20, 2026
…ythonGH-144059)(cherry picked from commitfe62926)Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
@bedevere-app
Copy link

GH-144073 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJan 20, 2026
@bedevere-app
Copy link

GH-144074 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJan 20, 2026
serhiy-storchaka pushed a commit that referenced this pull requestJan 20, 2026
…H-144059) (GH-144074)(cherry picked from commitfe62926)Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
serhiy-storchaka pushed a commit that referenced this pull requestJan 20, 2026
…H-144059) (GH-144073)(cherry picked from commitfe62926)Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Discrepancy betweenstat.filemode's C and Python implementation

2 participants

@VanshAgarwal24036@serhiy-storchaka

[8]ページ先頭

©2009-2026 Movatter.jp