-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
os.lstat() supports dir_fd but is not in os.supports_dir_fd #134993
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi there, I tested this code and reproduce the case as you described. I noticed the following code in Line 120 in c211130
It included Reference: |
I proposed #135188 to fix the issue. |
(cherry picked from commit e004cf8) Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit e004cf8) Co-authored-by: Victor Stinner <vstinner@python.org>
Fixed. Thanks for your report. In the meanwhile, don't rely on |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
I had written a script using
os.fwalk()
andos.lstat()
, which was working.Then I added an
if os.lstat in os.supports_dir_fd
check and a fallback implementation and observed the fallback path being taken:The workaround is to check for os.stat instead (and use
os.stat(..., follow_symlinks=False)
for consistency).CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: