-
-
Notifications
You must be signed in to change notification settings - Fork 31.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
bpo-31779: Prevent assertion failures and a crash when using an uninitialized struct.Struct object #3984
Conversation
@@ -626,6 +626,20 @@ def test_format_attr(self): | |||
s2 = struct.Struct(s.format.encode()) | |||
self.assertEqual(s2.format, s.format) | |||
|
|||
@support.cpython_only |
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.
Why is this test cpython only?
This PR is stale because it has been open for 30 days with no activity. |
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.
Looks good:
struct_obj.iter_unpack(b'foo')
Traceback (most recent call last):
File "", line 1, in
ValueError: Struct.init() wasn't called
Can you respond to:
pppery on 16 Sep 2018
Why is this test cpython only?
Superseded by #94532 |
In addition, add tests to
test_struct
to make sure the assertion failures and the crash are no more.https://bugs.python.org/issue31779