-
Notifications
You must be signed in to change notification settings - Fork 752
Exception when passing a custom python object as the parameter #412
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 wonder if this ever worked. Can you try to reproduce this using |
@vmuriart I tested it with v2.0.0 (python2.7) and it failed with the same exception. v2.0.0 performs even worse than the current version, details was given as comments in the test code. Since there are many API not available in v2.0.0, so I wrote a new test, it's more concise and shown as below. The origin PythonEngine.RunString method in v2.0.0 has a bug, I fixed it in order to run the test.
|
@vmuriart By the way, how do you set up the environment to run a code snippet with old version of pythonnet and other version of Python? |
Thanks for testing on irt running on older pythonnet. Usually I write my tests on a Alternatively, you can also add your tests to the |
You can setup |
Uh oh!
There was an error while loading. Please reload this page.
Environment
Details
I want to call a .NET method from python and pass a python object as the parameter. If the .NET function declare the argument type as PyObject, everything is fine, however, if declare the argument type as object or dynamic, exception raised.
In my project, the exception is “System.OverflowException” in GetManagedObject method in managedtype.cs.
In order to reproduce it, I built a minimal example, but a new exception raised "TypeError : No method matches given arguments".
These two exception may have some relationship, so I put this one here first since it has a way to be reproduced.
This is similar to this issue and this PR fixed it. I tested it, when passing an int or string object the function of 2nd and 3rd signature can be found, but when passing a python object, exception raised.
Here is the minimal example,
The text was updated successfully, but these errors were encountered: