← 输入框|github.com|刷新
Skip to content

gh-50720: Set errno and strerror on URLError wrapping an OSError - #160938

Open
vasiliyk wants to merge 1 commit into
python:mainfrom
vasiliyk:gh-50720-urllib
Open

vasiliyk wants to merge 1 commit into
python:mainfrom
vasiliyk:gh-50720-urllib

Conversation

@vasiliyk

@vasiliyk vasiliyk commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

URLError wrapping an OSError such as socket.gaierror always had errno and strerror set to None.

This PR copies errno and strerror from the reason when it is an OSError.
A string reason leaves both attributes None, as before.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35513341 | 📁 Comparing fd2a709 against main (ef1fce0)

  🔍 Preview build  

2 files changed
± library/urllib.error.html
± whatsnew/changelog.html

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant