-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import struct
class MyStruct(struct.Struct):
def __init__(self):
super().__init__('>h')
obj = MyStruct()
When I run this code I receive an error:
Traceback (most recent call last):
File "/home/user/bug.py", line 7, in <module>
obj = MyStruct()
^^^^^^^^^^
TypeError: Struct() missing required argument 'format' (pos 1)
It is rather strange error, I have passed format
parameter to base class constructor, I receive this error with any value of format
parameter.
There are no any problems with this code in Python 3.11 and older.
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error