Skip to content

Instantly share code, notes, and snippets.

@devdanzin
Created March 18, 2026 10:07
Show Gist options
  • Select an option

  • Save devdanzin/551cace22f112ef0ff4ed3fdbe54d235 to your computer and use it in GitHub Desktop.

Select an option

Save devdanzin/551cace22f112ef0ff4ed3fdbe54d235 to your computer and use it in GitHub Desktop.
typeobject.c: Missing return -1 after PyErr_Format in type_ready_post_checks

typeobject.c: Missing return -1 after PyErr_Format in type_ready_post_checks

Summary

At line 9314-9320, PyErr_Format sets a SystemError for invalid tp_dictoffset but falls through to return 0 (success). Type finishes initialization with invalid offset and pending exception. Requires C extension to trigger.

Fix

Add return -1; after the PyErr_Format call at line 9317.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment