-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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-23578: Show which offset raise error when using struct.pack #291
Conversation
This looks like a reasonable improvement. |
@rhettinger I'm not sure about the global variable. Is there any way to test if global variable has the defect when using threads? |
Adding PyErr_SetString and PyErr_Format wrapper, with a global offset variable to handle this. >>> struct.pack('!h', 0x8FFFF) Traceback (most recent call last): File "tests.py", line 5, in <module> struct.pack('!h', 0x8FFFF) struct.error: Raise at offset 1, 'h' format requires -32768 <= number <= 32767
@serhiy-storchaka I removed the global offset variable, and add a new parameter Could you help me review this? Thanks. |
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.
plz re base
This change is from an unknown repository and this GitHub account is no longer active. I'm going to close this PR so that another one could be opened to replace it. |
Adding PyErr_SetString and PyErr_Format wrapper, with a global offset
variable to handle this.