-
Notifications
You must be signed in to change notification settings - Fork 748
Registering RawProxyEncoder Causes Stack Overflow #1427
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
I investigated this issue. Stack overflow happens when trying access a C# object, that might need codec (but does not have one), and there's at least one encoder implemented and registered from Python (like What happens is that in order to call |
(stack overflow trying to pass `System.Type` to `CanEncode`)
(stack overflow trying to pass `System.Type` to `CanEncode`)
(stack overflow trying to pass `System.Type` to `CanEncode`)
(stack overflow trying to pass `System.Type` to `CanEncode`)
Without this restriction encoders created in Python cause stack overflow due to repeated attempts to pass `System.Type` instance to `CanDecode`, which requires encoding the instance of `System.Type`, et. cetera fixes pythonnet#1427
(stack overflow trying to pass `System.Type` to `CanEncode`)
Without this restriction encoders created in Python cause stack overflow due to repeated attempts to pass `System.Type` instance to `CanDecode`, which requires encoding the instance of `System.Type`, et. cetera fixes pythonnet#1427
(stack overflow trying to pass `System.Type` to `CanEncode`)
Thanks for fixing this. I can't believe you did it so quickly. |
Haha, that's for the lack of time to work on new features :-D @richard-gemmell-42 |
Environment
Summary
Registering a
RawProxyEncoder
withPyObjectConversions.RegisterEncoder()
causes the script to fail with a stack overflow.Thanks
First of all, I'd like to say thanks to everyone who's contributed to this project. It's incredibly useful for us to write one set of code to serve both .NET and Python developers. We've had very few problems with Pythonnet. Thanks very much.
Details
I ran into a problem with Pythonnet converting System.Collections.Generic.List into a native python list as described in issue 1153.
lostmsu recommended using a RawProxyEncoder to disable the automatic conversion. Unfortunately, if I register an encoder and then call a .NET method the system crashes with a stack overflow.
The output is:
Commenting out the call to RegisterEncoder prevents the crash.
The text was updated successfully, but these errors were encountered: