Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
When an overflow occurs, we get no OverflowError("nice error message")
but a warning message and some empty overflow error.
This can be seen in a shiboken test by passing -i:
$ python3 -i /Users/tismer/src/QtC/pyside-setup/sources/shiboken2/tests/samplebinding/point_test.py ......../usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/case.py:202: RuntimeWarning: libshiboken: Overflow: Value 840835495615213080 exceeds limits of type [unsigned] "j" (4bytes). callable_obj(*args, **kwargs) . ---------------------------------------------------------------------- Ran 9 tests in 0.002s OK Traceback (most recent call last): File "/Users/tismer/src/QtC/pyside-setup/sources/shiboken2/tests/samplebinding/point_test.py", line 116, in <module> unittest.main() File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/main.py", line 101, in __init__ self.runTests() File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/main.py", line 273, in runTests sys.exit(not self.result.wasSuccessful()) SystemExit: False
Now we enter something into the test:
>>> Point(0.0, 0.0).setXAsUint(-1) <stdin>:1: RuntimeWarning: libshiboken: Overflow: Value -1 exceeds limits of type [unsigned] "j" (4bytes). Traceback (most recent call last): File "<stdin>", line 1, in <module> OverflowError >>>
This should not be a warning followed by an empty error, but always a nicely
visible error.
sources/shiboken2/libshiboken/sbkconverter_p.h:128
Attachments
Issue Links
- relates to
-
PYSIDE-1000 Improve the primitive type conversion rules
- Reported