GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — WIP: Always pass errno argument for OSError subclasses by serhiy-storchaka · Pull Request #109720 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 22, 2023

Copy link
Copy Markdown
Member

It solves #109601, but covers not only TimeoutError, but other OSError subclasses.

With #109714 these changes will be unneeded (except that some calls may be improved to set filename), because errno and strerror will be set automatically. This PR is a demonstration of changes when do it explicitly. #109714 be accepted and we decide to apply these changes to older versions, this PR will be converted in a backport PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
WIP: Always pass errno argument for OSError subclasses
9f418cd
@serhiy-storchaka serhiy-storchaka mentioned this pull request Sep 22, 2023
Improve OSError constructor #109714
Open
@aisk aisk mentioned this pull request Jul 17, 2024
create_connection and create_server in asyncio didn't work with a Python build with IPv6 disabled #121913
Closed
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 14, 2026
serhiy-storchaka and others added 2 commits August 26, 2026 22:59
@serhiy-storchaka
Merge branch 'main' into errno-for-oserror-subclasses
239ccf3
# Conflicts:
#	Lib/asyncio/tasks.py
#	Lib/asyncio/timeouts.py
#	Lib/importlib/resources/abc.py
#	Lib/importlib/resources/readers.py
#	Lib/importlib/resources/simple.py
#	Lib/multiprocessing/pool.py
#	Lib/socket.py
#	Lib/zipfile/_path/__init__.py
@serhiy-storchaka @claude
Always pass errno when raising OSError subclasses
5464589
Concrete OSError subclasses raised in the stdlib often carried no errno at
all, so exc.errno was None and str(exc) lacked the usual "[Errno N]" prefix.
Pass an appropriate errno (and a filename where one is available) everywhere
such an exception is raised.

In C code, PyErr_SetString() with an OSError subclass has the same problem.
Add _PyErr_SetOSErrorWithMessage(), which builds the (errno, msg) pair, and
use it in sys.remote_exec(), _io.TextIOWrapper.read(), _interpchannels and
_Py_RemoteDebug_WriteRemoteMemory().  In _ssl the existing set_timeout_err()
helper covers the remaining sites.

turtle.TurtleScreen.save() now passes the offending path as the filename
argument instead of embedding it in the message, so its errors gain the
"[Errno N] ...: 'path'" form.  test_turtle and the as_completed() timeout
test are updated for the new messages.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jaraco jaraco Awaiting requested review from jaraco jaraco will be requested when the pull request is marked ready for review jaraco is a code owner
@StanFromIreland StanFromIreland Awaiting requested review from StanFromIreland StanFromIreland will be requested when the pull request is marked ready for review StanFromIreland is a code owner
@gpshead gpshead Awaiting requested review from gpshead gpshead will be requested when the pull request is marked ready for review gpshead is a code owner
@giampaolo giampaolo Awaiting requested review from giampaolo giampaolo will be requested when the pull request is marked ready for review giampaolo is a code owner
@vsajip vsajip Awaiting requested review from vsajip vsajip will be requested when the pull request is marked ready for review vsajip is a code owner
@cmaloney cmaloney Awaiting requested review from cmaloney cmaloney will be requested when the pull request is marked ready for review cmaloney is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw will be requested when the pull request is marked ready for review warsaw is a code owner
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 will be requested when the pull request is marked ready for review FFY00 is a code owner
@pganssle pganssle Awaiting requested review from pganssle pganssle will be requested when the pull request is marked ready for review pganssle is a code owner
@picnixz picnixz Awaiting requested review from picnixz picnixz will be requested when the pull request is marked ready for review picnixz is a code owner
@1st1 1st1 Awaiting requested review from 1st1 1st1 will be requested when the pull request is marked ready for review 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov will be requested when the pull request is marked ready for review asvetlov is a code owner
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303 kumaraditya303 will be requested when the pull request is marked ready for review kumaraditya303 is a code owner
@willingc willingc Awaiting requested review from willingc willingc will be requested when the pull request is marked ready for review willingc is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently will be requested when the pull request is marked ready for review ericsnowcurrently is a code owner
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal will be requested when the pull request is marked ready for review pablogsal is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland will be requested when the pull request is marked ready for review erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner will be requested when the pull request is marked ready for review AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.