Skip to content

Multiple assertion failures for Python classes derived from System.Exception in debug builds #1218

@lostmsu

Description

@lostmsu

Environment

  • Pythonnet version: 2.5.1
  • Python version: 3.8
  • Operating System: Win 10 64

Details

In debug build (DebugWinPY3) this test:

class Sub(System.Exception):

fails this assertion:

Debug.Assert(typeSize > 0 && typeSize <= ExceptionOffset.Size());

Python type object for Sub class gets an unknown extra field of size IntPtr.Size, causing it to be larger than its base type object (reflected) System.Exception.

See also #1196 (comment) for previous discussion.

@koubaa @amos402

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions