bpo-23578: Show which offset raise error when using struct.pack#291
Closed
louisom wants to merge 7 commits intopython:masterfrom
louisom:bpo-23578
Closed
bpo-23578: Show which offset raise error when using struct.pack#291louisom wants to merge 7 commits intopython:masterfrom louisom:bpo-23578
louisom wants to merge 7 commits intopython:masterfrom
louisom:bpo-23578
Conversation
Contributor
|
This looks like a reasonable improvement. |
Contributor
Author
|
@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
Contributor
Author
|
@serhiy-storchaka I removed the global offset variable, and add a new parameter Could you help me review this? Thanks. |
Contributor
|
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. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding PyErr_SetString and PyErr_Format wrapper, with a global offset
variable to handle this.