gh-47169: Use the symbolic errno name in OSError error messages#14988
gh-47169: Use the symbolic errno name in OSError error messages#14988ZackerySpytz wants to merge 4 commits intopython:mainfrom
Conversation
gnprice
left a comment
There was a problem hiding this comment.
Thanks -- this will be a useful feature!
The patch calls PyImport_ImportModule("errno"), the equivalent of import errno, to get the table of names. In that bpo discussion, several people were concerned about doing an import here. It'd be good to say a few words about how this patch addresses those concerns.
|
Hmm, GitHub's UI now hides this comment above, so I'll make it again here in the main thread: I think this logic would be clearer by avoiding Probably a good way to do that is to pull this whole block into its own function. (In discussion, I added:) There's one very useful way of using Other cases where @ZackerySpytz , I see your comment suggesting you'd like to hear from a core developer on this question; wanted to pull this out just so the thread isn't lost in the GitHub mists. 😉 |


For example:
ENOENTis shown instead of the integer value.https://bugs.python.org/issue2920