Skip to content
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

Closed

Conversation

orenmn
Copy link
Contributor

@orenmn orenmn commented Oct 13, 2017

In addition, add tests to test_struct to make sure the assertion failures and the crash are no more.

https://bugs.python.org/issue31779

@@ -626,6 +626,20 @@ def test_format_attr(self):
s2 = struct.Struct(s.format.encode())
self.assertEqual(s2.format, s.format)

@support.cpython_only
Copy link

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?

@github-actions
Copy link

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

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 28, 2022
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a 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?

@kumaraditya303
Copy link
Contributor

Superseded by #94532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants