On Mon, Jun 14, 2021 at 2:54 PM Miro Hrončok <mhroncok@xxxxxxxxxx> wrote: > > On 14. 06. 21 14:17, Miro Hrončok wrote: > >> I see one problem with the Rust bindings for CPython / libpython, > >> where the test suite now fails with Python 3.10: > >> https://koschei.fedoraproject.org/package/rust-cpython? > >> > >> Looking at the build log, the new test failures seem to be caused by > >> either API removals or subtle behaviour changes: > >> > >> - TypeError: 'float' object cannot be interpreted as an integer > > > > Indeed. wrap it in int() or math.floor()/ceil() as needed. > > > > I suspect this is related to: > > > > https://docs.python.org/3.10/whatsnew/3.10.html#other-language-changes > > > > """ > > Builtin and extension functions that take integer arguments no longer accept > > Decimals, Fractions and other objects that can be converted to integers only > > with a loss (e.g. that have the __int__() method but do not have the > > __index__() method). https://bugs.python.org/issue37999 > > """ > > Can I get the Python traceback somehow? The rust thing (object?) seem to have: > > PyErr { ptype: <class 'TypeError'>, pvalue: Some("'float' object cannot be > interpreted as an integer"), ptraceback: None } Not sure ... looking at the sources for the tests: https://github.com/dgrunwald/rust-cpython/blob/master/src/objects/num.rs#L340 It seems that this just will not work as expected for some float -> int -> float roundtrip conversions any longer, due to the changes in python 3.10. Fabio _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure