bpo-31779: Prevent assertion failures and a crash when using an uninitialized struct.Struct object by orenmn · Pull Request #3984 · python/cpython
Conversation
| 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?
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
mannequin
mentioned this pull request
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