-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
wrong type for wintypes.BYTE #60580
Comments
Windows BYTE type is unsigned char, but ctypes defines it as signed. {{{
BYTE
A byte (8 bits).
This type is declared in WinDef.h as follows:
typedef unsigned char BYTE;
typedef unsigned char BYTE;
}}}
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx http://hg.python.org/cpython/file/e5f39546989f/Lib/ctypes/wintypes.py#l4 |
All cbytes tests passed after the change was made but I've no idea as to the impact of this. |
This bug can cause people to make grave mistakes when using WIndows APIs. Im assuming this is a simple fix too. Run this code as shown and then run the code with types https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-system_power_status This would be a |
Created from a patch file attached to an issue, by Anatoly Techtonik.
Fixed by gh-97579; no backporting is planned. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
ctypes.wintypes.BYTE
#97579The text was updated successfully, but these errors were encountered: