bpo-31779: Prevent assertion failures and a crash when using an uninitialized struct.Struct object by orenmn · Pull Request #3984 · python/cpython

Conversation

pppery

s2 = struct.Struct(s.format.encode())
self.assertEqual(s2.format, s.format)

@support.cpython_only

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

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

MaxwellDupre

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?

@orenmn orenmn mannequin mentioned this pull request

Jul 3, 2022

@kumaraditya303

Labels