FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-72660: Handle unsigned long win32 error codes by ameily · Pull Request #27959 · python/cpython · GitHub

/ cpython Public

gh-72660: Handle unsigned long win32 error codes - #27959

Open
ameily wants to merge 7 commits into
python:mainfrom
ameily:fix-issue-28474
Open

gh-72660: Handle unsigned long win32 error codes#27959
ameily wants to merge 7 commits into
python:mainfrom
ameily:fix-issue-28474

Conversation

ameily commented Aug 26, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

bpo-28474: Handle unsigned long win32 error codes

Windows Error Codes are DWORD values. This PR ensures that error codes larger than LONG_MAX are handled. Previously, an overflow exception was raised for large, but valid, win32 error codes, such as E_POINTER 0x80000005.

https://bugs.python.org/issue28474

ameily changed the title Handle unsigned long win32 error codes bpo-27484: Handle unsigned long win32 error codes Aug 26, 2021
ameily changed the title bpo-27484: Handle unsigned long win32 error codes bpo-28474: Handle unsigned long win32 error codes Aug 26, 2021

zooba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Change looks good, I think we can improve the error messages slightly.

Comment thread Modules/_ctypes/callproc.c Outdated
Comment thread Modules/_ctypes/callproc.c Outdated
Comment thread Objects/exceptions.c Outdated
Comment thread Objects/exceptions.c Outdated
ameily requested a review from zooba September 1, 2021 22:24

github-actions Bot commented Oct 2, 2021

Copy link
Copy Markdown

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

github-actions Bot added the stale Stale PR or inactive for long period of time. label Oct 2, 2021

ameily commented Oct 2, 2021

Copy link
Copy Markdown
Contributor Author

@zooba I've rebased from upstream/main and have addressed all feedback items, except one that I think it out of scope. Let me know if you need anything else from me.

github-actions Bot removed the stale Stale PR or inactive for long period of time. label Oct 3, 2021

MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Changing to "|L:FormatError" makes sense.
LGTM

arhadthedev changed the title bpo-28474: Handle unsigned long win32 error codes gh-72660: Handle unsigned long win32 error codes Apr 29, 2023
arhadthedev modified the milestone: n100095 Apr 30, 2023
arhadthedev requested review from a team and iritkatriel as code owners April 30, 2023 14:47

zooba commented May 2, 2023

Copy link
Copy Markdown
Member

The failed tests look like winerror_to_errno isn't handling error code with the top bit set properly, but I suspect it's due to the conversions we've added.

I'm also a little concerned about changing values in OSError.winerror for users. Not sure whether our tests cover that, but that seems like an annoying change that I'd rather not make.1

Footnotes

  1. Won't affect my own code, because I always ex.winerror & 0xFFFFFFFF before comparing, but I don't believe that's a universal pattern.

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

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

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review OS-windows stale Stale PR or inactive for long period of time. topic-ctypes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL