Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

struct.Struct inheritance with Python 3.12.0 #112358

Closed
Assignees
mdickinsonkumaraditya303
Labels
3.12only security fixes3.13bugs and security fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error
@livrrr

Description

@livrrr

Bug report

Bug description:

importstructclassMyStruct(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 passedformat parameter to base class constructor, I receive this error with any value offormat 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

Labels

3.12only security fixes3.13bugs and security fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp