Skip to content

Conversation

@brianschubert
Copy link
Member

Refs #9864, follows from #12910

Like OSError.errno, strerror can sometimes be None. Usually, both attributes are None at the same time.

Since we added None to errno, it probably makes sense to do the same for strerror.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@brianschubert
Copy link
Member Author

I'm pleasantly surprised that there isn't a significant primer hit like there was with errno. Perhaps that's because strerror is often used in a string-formatting/printing context, where None would be legal anyway, e.g. raise MyCustomError(f"some message: {ex.strerror}").

@JelleZijlstra JelleZijlstra merged commit dafd67c into python:main Nov 7, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants