- Notifications
You must be signed in to change notification settings - Fork752
Closed
Description
Environment
- Pythonnet version: 2.4.0
- Python version: Python 2.7.13
- Operating System: Windows 10
Details
Describe what you were trying to get done.
I want to use a .net library that I access through pythonnet in combination with a library that was compiled with Nuitka (the contents of the library do not seem to matter, nor the version of Nuitka). However, when I import the module in the pyd first, calling 'import clr' after that crashes pythonnet and then Python.
I was wondering if this is a known issue/how easy it would be to fix it/if there would be some straightforward workaround so the order of imports would not matter?
- 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.
importfooimportclr
Will crash pythonnet and then Python. Changing the order of the imports will make it work, however it will make working with the .net library very annoying.
Relevant files are in the zip:
minimal_example.zip
- If there was a crash, please include the traceback here.
UnhandledException:System.Reflection.TargetInvocationException:Exceptionhasbeenthrownbythetargetofaninvocation.--->System.AccessViolationException:Attemptedtoreadorwriteprotectedmemory.Thisisoftenanindicationthatothermemoryiscorrupt.atPython.Runtime.Runtime.PyModule_GetDict(IntPtrmodule)atPython.Runtime.PythonEngine.Initialize(IEnumerable`1args,BooleansetSysArgv,BooleaninitSigs)atPython.Runtime.PythonEngine.InitExt()---Endofinnerexceptionstacktrace---atSystem.RuntimeMethodHandle.InvokeMethod(Objecttarget,Object[]arguments,Signaturesig,Booleanconstructor)atSystem.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Objectobj,Object[]parameters,Object[]arguments)atSystem.Reflection.RuntimeMethodInfo.Invoke(Objectobj,BindingFlagsinvokeAttr,Binderbinder,Object[]parameters,CultureInfoculture)atSystem.RuntimeType.InvokeMember(Stringname,BindingFlagsbindingFlags,Binderbinder,Objecttarget,Object[]providedArgs,ParameterModifier[]modifiers,CultureInfoculture,String[]namedParams)atclrModule.initclr()
Metadata
Metadata
Assignees
Labels
No labels