-
Notifications
You must be signed in to change notification settings - Fork 751
Crash when using nested classes with inheritance, which are instantiated from C# #1414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for the bug report. Two things:
|
On my Mac I do not get any error message, the process dies silently. I have a report from a Windows machine with the following error:
I have also tested this in master, and the same crash and workaround applies. |
Thank you, I'll try to reproduce this. |
lostmsu
added a commit
to losttech/pythonnet
that referenced
this issue
Oct 1, 2021
…located. fixes pythonnet#1414 Without this fix attempting to use a nested .NET class that derives from its parent would cause a crash due to false mutual dependency.
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Details
I am accessing a member of a nested C# class which inherits from the enclosing class.
When doing this, the Pythonnet runtime crashes!
Here is a minimal example:
This seem to be specifically for nested classes, where the object instance is created from the C# environment, and the class has not been explicitly referenced/used from python.
I have found a way to prevent the crash, by first explicitly using the nested class in the python code.
Eg instead of this:
I insert a reference to the nested
Bar.Hej
classIf I do this, then the Pythonnet runtime no longer crashes. It is even enough to reference the enclosing baseclass
Bar
When I do this, the python code executes properly:
The text was updated successfully, but these errors were encountered: