-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-37705: Improve the implementation of winerror_to_errno() #15623
bpo-37705: Improve the implementation of winerror_to_errno() #15623
Conversation
winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @ZackerySpytz.
I am very much in favor of using constants to give the winerrors more semantic meaning and grouping the returns. However, there's several of the constant names which don't describe their purpose in a meaningful way. I'm not familiar with our stance on linking to external documentation within code comments, but it seems like it might be helpful to provide a link to https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2.
Stever Downer (@zooba) mentioned adding a dict in Modules/errnomodule.c that exposes this mapping to Python code. I guess it could be called For Winsock errors, I think the |
I'm merging and backporting this, as the additional error codes are general goodness that will improve all active versions. Adding a new public API should be only for master. |
Thanks @ZackerySpytz for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
GH-15749 is a backport of this pull request to the 3.8 branch. |
GH-15750 is a backport of this pull request to the 3.7 branch. |
winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ. (cherry picked from commit 19052a1) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ. (cherry picked from commit 19052a1) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
…H-15623) winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
…H-15623) winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
…H-15623) winerror_to_errno() is no longer automatically generated. Do not rely on the old _dosmapperr() function. Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
After pythonGH-15623 deleted `generrmap.c`, a related mak-file stopped working. The mak contains generrmap-related rules only so it should be removed altogether. Further search for `errmap\.mak|generrmap` regex through content of CPython files shows no dangling reference left.
After GH-15623 deleted `generrmap.c`, a related mak-file stopped working. The mak contains generrmap-related rules only so it should be removed altogether. Further search for `errmap\.mak|generrmap` regex through content of CPython files shows no dangling reference left. Since generrmap is already effectively removed, this pull request contains no blurp.
winerror_to_errno() is no longer automatically generated.
Do not rely on the old _dosmapperr() function.
Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
Many thanks go to Eryk Sun for their posts on the BPO issue.
https://bugs.python.org/issue37705