René's URL Explorer Experiment


Title: gh-145335: Fix os functions when passing fd -1 as path by vstinner · Pull Request #145439 · python/cpython · GitHub

Open Graph Title: gh-145335: Fix os functions when passing fd -1 as path by vstinner · Pull Request #145439 · python/cpython

X Title: gh-145335: Fix os functions when passing fd -1 as path by vstinner · Pull Request #145439 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: os.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF) rather than listing the current directory. os.listxattr(-1) now fails with OSError(errno.EBADF) rather than listing extended att...

X Description: os.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF) rather than listing the current directory. os.listxattr(-1) now fails with OSError(errno.EBADF) rather than listing extended att...

Opengraph URL: https://github.com/python/cpython/pull/145439

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:a9f77f1b-df94-ab01-f659-104fc91ec554
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC5E6:1BF8C0:4FA8F2:6A5EBA:6A52993E
html-safe-nonce4ba28fd176ee5e565a0aab710559d5ada4899907db9f590816150c6202a239df
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUU2OjFCRjhDMDo0RkE4RjI6NkE1RUJBOjZBNTI5OTNFIiwidmlzaXRvcl9pZCI6Ijg4MDIwMjA0NDM5MzI0OTgyMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac441bd3283a9d2fb52f8c5f24292ed677427545c0f5a3fa2c27e15c6a30d91083
hovercard-subject-tagpull_request:3345690899
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/145439/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/2defc2c71ad0e3331b0a7cdfbba49e927264c96553f526b453fafa1c961bd138/python/cpython/pull/145439
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2defc2c71ad0e3331b0a7cdfbba49e927264c96553f526b453fafa1c961bd138/python/cpython/pull/145439
og:image:altos.listdir(-1) and os.scandir(-1) now fail with OSError(errno.EBADF) rather than listing the current directory. os.listxattr(-1) now fails with OSError(errno.EBADF) rather than listing extended att...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-cache
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/145439#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F145439
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F145439
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/145439
Reloadhttps://github.com/python/cpython/pull/145439
Reloadhttps://github.com/python/cpython/pull/145439
Please reload this pagehttps://github.com/python/cpython/pull/145439
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/145439
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:ebadfhttps://github.com/vstinner/cpython/tree/ebadf
Conversationhttps://github.com/python/cpython/pull/145439
Commits5 (5)https://github.com/python/cpython/pull/145439/commits
Checkshttps://github.com/python/cpython/pull/145439/checks
Files changedhttps://github.com/python/cpython/pull/145439/files
gh-145335: Fix os functions when passing fd -1 as pathhttps://github.com/python/cpython/pull/145439#top
vstinnerhttps://github.com/vstinner
python:mainhttps://github.com/python/cpython/tree/main
vstinner:ebadfhttps://github.com/vstinner/cpython/tree/ebadf
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 2, 2026https://github.com/python/cpython/pull/145439#issue-4012949453
Please reload this pagehttps://github.com/python/cpython/pull/145439
Segfault from running os.pathconf(-1, 1) #145335https://github.com/python/cpython/issues/145335
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
pythongh-145335https://github.com/python/cpython/issues/145335
: Fix os functions when passing fd -1 as pathhttps://github.com/python/cpython/pull/145439/commits/d57be548267cd5a002c317e446f5909ff768999d
d57be54https://github.com/python/cpython/pull/145439/commits/d57be548267cd5a002c317e446f5909ff768999d
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Mar 2, 2026 https://github.com/python/cpython/pull/145439#ref-issue-4003261608
Segfault from running os.pathconf(-1, 1) #145335 https://github.com/python/cpython/issues/145335
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 2, 2026 https://github.com/python/cpython/pull/145439#ref-pullrequest-4007214840
gh-145335: Fix crash when passing -1 as fd in os.pathconf #145390 https://github.com/python/cpython/pull/145390
vstinnerhttps://github.com/vstinner
March 2, 2026 20:55https://github.com/python/cpython/pull/145439#commits-pushed-d9f6410
https://github.com/vstinner
fix pathconf testhttps://github.com/python/cpython/pull/145439/commits/d9f64104a6b129c2df30662ffc4525a6d4a64c73
d9f6410https://github.com/python/cpython/pull/145439/commits/d9f64104a6b129c2df30662ffc4525a6d4a64c73
https://github.com/vstinner
Fix tests on Windowshttps://github.com/python/cpython/pull/145439/commits/a8942627a890689c32575d094a9932c58c3a161e
a894262https://github.com/python/cpython/pull/145439/commits/a8942627a890689c32575d094a9932c58c3a161e
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Mar 2, 2026https://github.com/python/cpython/pull/145439#event-23205047105
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Mar 2, 2026https://github.com/python/cpython/pull/145439#issuecomment-3986773059
@vstinnerhttps://github.com/vstinner
a894262https://github.com/python/cpython/commit/a8942627a890689c32575d094a9932c58c3a161e
https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145439%2Fmergehttps://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145439%2Fmerge
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Mar 2, 2026https://github.com/python/cpython/pull/145439#event-23205115772
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 3, 2026https://github.com/python/cpython/pull/145439#issuecomment-3990080630
46c5c57https://github.com/python/cpython/commit/46c5c57226862bc078bcdf0c9f5b40951b8615a5
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
March 3, 2026 10:27https://github.com/python/cpython/pull/145439#event-23222382670
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Mar 3, 2026https://github.com/python/cpython/pull/145439#event-23222384360
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 3, 2026https://github.com/python/cpython/pull/145439#issuecomment-3990084388
Please reload this pagehttps://github.com/python/cpython/pull/145439
@picnixzhttps://github.com/picnixz
@aiskhttps://github.com/aisk
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Mar 3, 2026 https://github.com/python/cpython/pull/145439#pullrequestreview-3881976300
View reviewed changes https://github.com/python/cpython/pull/145439/files/a8942627a890689c32575d094a9932c58c3a161e
Misc/NEWS.d/next/Library/2026-03-02-20-08-09.gh-issue-145335.lVTBvd.rsthttps://github.com/python/cpython/pull/145439/files/a8942627a890689c32575d094a9932c58c3a161e#diff-9d7d849e532e1b7882e19f75106537176a71d56545421ebd8d380d363015092c
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Mar 3, 2026 https://github.com/python/cpython/pull/145439#pullrequestreview-3881984056
View reviewed changes https://github.com/python/cpython/pull/145439/files/a8942627a890689c32575d094a9932c58c3a161e
Lib/test/test_os/test_os.pyhttps://github.com/python/cpython/pull/145439/files/a8942627a890689c32575d094a9932c58c3a161e#diff-0c3c0e7d77a166e9089c5ddcc9d2db7c4fab9528044dec1fda4b3a6be569f784
Please reload this pagehttps://github.com/python/cpython/pull/145439
vstinnerhttps://github.com/vstinner
March 3, 2026 12:58https://github.com/python/cpython/pull/145439#commits-pushed-259f9fe
https://github.com/vstinner
Add versionchanged to listdir, scandir, listxattr dochttps://github.com/python/cpython/pull/145439/commits/259f9fe97fcddc224f2e01a3c9a6c3ece9db9b76
259f9fehttps://github.com/python/cpython/pull/145439/commits/259f9fe97fcddc224f2e01a3c9a6c3ece9db9b76
https://github.com/vstinner
Avoid repeating check_for_ebadf() in the testhttps://github.com/python/cpython/pull/145439/commits/14a6c0d19eeb97a719b521e2f6d3bca08f392e76
14a6c0dhttps://github.com/python/cpython/pull/145439/commits/14a6c0d19eeb97a719b521e2f6d3bca08f392e76
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
force-pushedhttps://github.com/python/cpython/compare/a8942627a890689c32575d094a9932c58c3a161e..14a6c0d19eeb97a719b521e2f6d3bca08f392e76
a894262https://github.com/python/cpython/commit/a8942627a890689c32575d094a9932c58c3a161e
14a6c0dhttps://github.com/python/cpython/commit/14a6c0d19eeb97a719b521e2f6d3bca08f392e76
Compare https://github.com/python/cpython/compare/a8942627a890689c32575d094a9932c58c3a161e..14a6c0d19eeb97a719b521e2f6d3bca08f392e76
March 3, 2026 12:00https://github.com/python/cpython/pull/145439#event-23224726345
https://github.com/picnixz
picnixzhttps://github.com/picnixz
Mar 3, 2026 https://github.com/python/cpython/pull/145439#pullrequestreview-3882217163
View reviewed changes https://github.com/python/cpython/pull/145439/files/14a6c0d19eeb97a719b521e2f6d3bca08f392e76
picnixzhttps://github.com/picnixz
https://github.com/python/cpython/pull/145439#pullrequestreview-3882217163
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Mar 3, 2026https://github.com/python/cpython/pull/145439#event-23225270946
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
52c8efahttps://github.com/python/cpython/commit/52c8efa87d028e57895d6a44f22caeb99a589711
Mar 3, 2026https://github.com/python/cpython/pull/145439#event-23226170011
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
March 3, 2026 12:57https://github.com/python/cpython/pull/145439#event-23226170981
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Mar 3, 2026https://github.com/python/cpython/pull/145439#event-23226171593
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 3, 2026https://github.com/python/cpython/pull/145439#issuecomment-3990853303
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 3, 2026https://github.com/python/cpython/pull/145439#issuecomment-3991066409
@picnixzhttps://github.com/picnixz
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/freakboy3742
freakboy3742https://github.com/freakboy3742
Mar 5, 2026https://github.com/python/cpython/pull/145439#issuecomment-4001294765
broken Emscripten buildshttps://buildbot.python.org/#/builders/1810/builds/1927
@hoodmanehttps://github.com/hoodmane
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/freakboy3742
freakboy3742https://github.com/freakboy3742
Mar 5, 2026 https://github.com/python/cpython/pull/145439#ref-pullrequest-3983955202
gh-145177: Support multiple Emscripten versions for Emscripten buildbot #145180 https://github.com/python/cpython/pull/145180
https://github.com/hoodmane
hoodmanehttps://github.com/hoodmane
Mar 5, 2026https://github.com/python/cpython/pull/145439#issuecomment-4003737483
@freakboy3742https://github.com/freakboy3742
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/hoodmane
hoodmanehttps://github.com/hoodmane
Mar 5, 2026https://github.com/python/cpython/pull/145439#issuecomment-4003904620
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/hoodmane
hoodmanehttps://github.com/hoodmane
Mar 5, 2026https://github.com/python/cpython/pull/145439#issuecomment-4003935555
#145528https://github.com/python/cpython/pull/145528
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
Mar 5, 2026https://github.com/python/cpython/pull/145439#issuecomment-4003994622
broken Emscripten buildshttps://buildbot.python.org/#/builders/1810/builds/1927
python/buildmaster-config#678https://github.com/python/buildmaster-config/pull/678
Please reload this pagehttps://github.com/python/cpython/pull/145439
ljfphttps://github.com/ljfp
Apr 25, 2026 https://github.com/python/cpython/pull/145439#ref-commit-a70bbfe
https://github.com/vstinner
https://github.com/ljfp
pythongh-145335https://github.com/python/cpython/issues/145335
: Fix os functions when passing fd -1 as path (https://github.com/ljfp/cpython/commit/a70bbfe3b5f8a128d1bc963f2e8f4c25f7ac3575
python#…https://github.com/python/cpython/pull/145439
a70bbfehttps://github.com/ljfp/cpython/commit/a70bbfe3b5f8a128d1bc963f2e8f4c25f7ac3575
…145439https://github.com/python/cpython/pull/145439
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F145439
https://github.com/picnixz
picnixz https://github.com/picnixz
https://github.com/python/cpython/pull/145439/files/14a6c0d19eeb97a719b521e2f6d3bca08f392e76
Please reload this pagehttps://github.com/python/cpython/pull/145439
https://github.com/vstinner
https://github.com/bedevere-bot
https://github.com/freakboy3742
https://github.com/hoodmane
https://github.com/picnixz
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.