GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__ · Issue #99275 · python/cpython

No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__  #99275

New issue
Copy link
New issue
Copy link
Closed
Closed
No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__ #99275
Copy link
Labels
topic-ctypestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@nyaoouo
nyaoouo
opened on Nov 9, 2022
Issue body actions

Bug report

No exception set but raise SystemError when setting _fields_ of ctypes.Structure in __init_subclass__
Reproduce code:

import ctypes


class ParentStructure(ctypes.Structure):
    def __init_subclass__(cls, **kwargs):
        cls._fields_ =[('v1',ctypes.c_uint),('v2',ctypes.c_uint),]
        super().__init_subclass__(**kwargs)


class ChildStructure(ParentStructure):
    pass

Output Exception

Traceback (most recent call last):
  File "D:\Projects\pythonProject\main.py", line 10, in <module>
    class ChildStructure(ParentStructure):
  File "D:\Projects\pythonProject\main.py", line 6, in __init_subclass__
    cls._fields_ =[('v1',ctypes.c_uint),('v2',ctypes.c_uint),]
SystemError: error return without exception set

Your environment

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32

  • PR: gh-99275: Fix SystemError in ctypes during __initsubclass__ #99283
  • PR: gh-99284: [ctypes] remove _use_broken_old_ctypes_structure_semantics_ #99285
  • PR: [3.11] gh-99275: Fix SystemError in ctypes during __initsubclass__ (GH-99283) #99447
  • PR: [3.10] gh-99275: Fix SystemError in ctypes during __initsubclass__ (GH-99283) #99448

Activity

  1. nyaoouo
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 9, 2022
  2. sobolevn
    added a commit that references this issue on Nov 9, 2022

    pythongh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__`

    19e99ea
  3. sobolevn
    added
    topic-ctypes
    on Nov 9, 2022
  4. sobolevn commented on Nov 9, 2022

    @sobolevn
    sobolevn
    on Nov 9, 2022
    Member
    More actions

    I proposed a PR that sets the exception.

  5. sobolevn
    added 3 commits that reference this issue on Nov 9, 2022

    pythongh-99275: [ctypes] remove `_use_broken_old_ctypes_structure_sem…

    956ba13

    pythongh-99275: [ctypes] remove `_use_broken_old_ctypes_structure_sem…

    d6324a3

    pythongh-99275: [ctypes] remove `_use_broken_old_ctypes_structure_sem…

    45cec36
  6. gpshead
    added a commit that references this issue on Nov 13, 2022

    gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (#9…

    343eb0f
  7. miss-islington
    added 4 commits that reference this issue on Nov 13, 2022

    pythongh-99275: Fix `SystemError` in `ctypes` during `__initsubclass_…

    16f1716

    pythongh-99275: Fix `SystemError` in `ctypes` during `__initsubclass_…

    595055c

    gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (GH…

    14c1395

    gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (GH…

    bf76d9b
  8. serhiy-storchaka
    added this to Ctypes issueson Jan 1, 2024
  9. encukou commented on Sep 18, 2024

    @encukou
    encukou
    on Sep 18, 2024
    Member
    More actions

    Thanks for the fix! I'll close the issue.

  10. encukou
    closed this as completedon Sep 18, 2024
  11. github-project-automation
    moved this to Done in Ctypes issueson Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-ctypestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Ctypes issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.