Skip to content

cannot get anymore int of enumclass (alpha2) #1810

@maxcapodi78

Description

@maxcapodi78

Environment

  • Pythonnet version: 3.0.0dev
  • Python version: 3.9
  • Operating System: Windows
  • .NET Runtime:

Details

  • Describe what you were trying to get done.

In v2.5.2 I'm able to get a C# enum and get the int value. In alpha 2 it seems that the full enum class is returned but the int command is not working. In 3.0.0dev it makes crashing the Debugger.

  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.
    image

  • If there was a crash, please include the traceback here.

    Out[13]: <bound method 'int'>

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Python.Runtime.Runtime.PyLong_FromLongLong(Int64 value)
at Python.Runtime.PyInt..ctor(Int64 value)
at Python.Runtime.EnumOps`1.int(T value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Python.Runtime.MethodBinder.Invoke(BorrowedReference inst, BorrowedReference args, BorrowedReference kw, MethodBase info, MethodBase[] methodinfo)
at Python.Runtime.MethodObject.Invoke(BorrowedReference target, BorrowedReference args, BorrowedReference kw, MethodBase info)
at Python.Runtime.MethodBinding.tp_call(BorrowedReference ob, BorrowedReference args, BorrowedReference kw)

Process finished with exit code -532462766

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