-
Notifications
You must be signed in to change notification settings - Fork 751
Invalid method binding with specified .NET parameters #486
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
Konstantin-Posudevskiy
added a commit
to Konstantin-Posudevskiy/pythonnet
that referenced
this issue
Jun 12, 2017
Fix problem of conversion 'float' and 'double' values in converter.cs. As there was a range check both for 'float' and 'double' values, which are less or greater than its 'MinValue' and 'MaxValue' accordingly, several values like 'float.NegativeInfinity', 'float.PositiveInfinity' and the same 'double' values cannot be converted from Python to .NET values. Add error check after 'PyFloat_AsDouble' call. Due to Python C API documentation, method 'PyFloat_AsDouble' can return '-1.0' upon failure. So it requires error check. This rule forces to check for error and throw exception in case of error. Add tests, which cover problem of conversion 'float' and 'double' values. Resolves: pythonnet#486.
Konstantin-Posudevskiy
added a commit
to Konstantin-Posudevskiy/pythonnet
that referenced
this issue
Jun 12, 2017
Fix problem of conversion 'float' and 'double' values in converter.cs. As there was a range check both for 'float' and 'double' values, which are less or greater than its 'MinValue' and 'MaxValue' accordingly, several values like 'float.NegativeInfinity', 'float.PositiveInfinity' and the same 'double' values cannot be converted from Python to .NET values. Add error check after 'PyFloat_AsDouble' call. Due to Python C API documentation, method 'PyFloat_AsDouble' can return '-1.0' upon failure. So it requires error check. This rule forces to check for error and throw exception in case of error. Add tests, which cover problem of conversion 'float' and 'double' values. Resolves: pythonnet#486.
related: #100 |
den-run-ai
pushed a commit
that referenced
this issue
Jun 14, 2017
* Fix conversion of 'float' and 'double' values Fix problem of conversion 'float' and 'double' values in converter.cs. As there was a range check both for 'float' and 'double' values, which are less or greater than its 'MinValue' and 'MaxValue' accordingly, several values like 'float.NegativeInfinity', 'float.PositiveInfinity' and the same 'double' values cannot be converted from Python to .NET values. Add error check after 'PyFloat_AsDouble' call. Due to Python C API documentation, method 'PyFloat_AsDouble' can return '-1.0' upon failure. So it requires error check. This rule forces to check for error and throw exception in case of error. Add tests, which cover problem of conversion 'float' and 'double' values. Resolves: #486. * Fix failing 'test_double_conversion' test Fix incorrect part of 'test_double_conversion' test in test_conversion.py. An 'OverflowError' was expected for valid values, which represent Python 'inf' and '-inf'. The problem was identified with support of conversion for Python 'inf' and '-inf' to .NET System.Double PositiveInfinity and NegativeInfinity. See also: #487.
testrunner123
pushed a commit
to testrunner123/pythonnet
that referenced
this issue
Sep 22, 2017
* Fix conversion of 'float' and 'double' values Fix problem of conversion 'float' and 'double' values in converter.cs. As there was a range check both for 'float' and 'double' values, which are less or greater than its 'MinValue' and 'MaxValue' accordingly, several values like 'float.NegativeInfinity', 'float.PositiveInfinity' and the same 'double' values cannot be converted from Python to .NET values. Add error check after 'PyFloat_AsDouble' call. Due to Python C API documentation, method 'PyFloat_AsDouble' can return '-1.0' upon failure. So it requires error check. This rule forces to check for error and throw exception in case of error. Add tests, which cover problem of conversion 'float' and 'double' values. Resolves: pythonnet#486. * Fix failing 'test_double_conversion' test Fix incorrect part of 'test_double_conversion' test in test_conversion.py. An 'OverflowError' was expected for valid values, which represent Python 'inf' and '-inf'. The problem was identified with support of conversion for Python 'inf' and '-inf' to .NET System.Double PositiveInfinity and NegativeInfinity. See also: pythonnet#487.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Details
There is an example, how you can reproduce this bug.
C# code
Python code:
The text was updated successfully, but these errors were encountered: