Bug 1890444 - python-isodate fails to build with Python 3.10: Tries to use Decimal as an integer [NEEDINFO]
Summary: python-isodate fails to build with Python 3.10: Tries to use Decimal as an in...
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: python-isodate
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: James Laska
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2020-10-22 08:51 UTC by Tomáš Hrnčiar
Modified: 2021-02-16 04:16 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Type: Bug
mhroncok: needinfo? (jal233)

Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-10-22 08:51:16 UTC
python-isodate fails to build with Python 3.10.0a1.

ERROR: test_totimedelta (isodate.tests.test_duration.DurationTest)
Test conversion form Duration to timedelta.
Traceback (most recent call last):
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/tests/test_duration.py", line 400, in test_totimedelta
    self.assertEqual(dur.totimedelta(datetime(1998, 2, 25)),
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/duration.py", line 320, in totimedelta
    return (start + self) - start
  File "/builddir/build/BUILD/isodate-0.6.0/src/isodate/duration.py", line 183, in __add__
    newdt = other.replace(year=newyear, month=newmonth, day=newday)
TypeError: 'decimal.Decimal' object cannot be interpreted as an integer

Ran 278 tests in 0.070s

FAILED (errors=45)
Test failed: <unittest.runner.TextTestResult run=278 errors=45 failures=0>

For the build logs, see:

For all our attempts to build python-isodate with Python 3.10, see:

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-10-22 11:53:37 UTC

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

Comment 2 Miro Hrončok 2020-10-22 11:55:04 UTC
With Python 3.9 (current rawhide) I see the DeprecationWarning about this in build.log: https://koji.fedoraproject.org/koji/buildinfo?buildID=1565949

Comment 3 Dan Scott 2020-10-22 12:27:24 UTC
Looks like we'll need to pull in https://github.com/gweis/isodate/issues/58 ?

Comment 4 Dan Scott 2020-10-22 12:29:00 UTC
Err, the direct link to the pull request is https://github.com/gweis/isodate/pull/60

Upstream has been inactive for over two years.

Comment 5 Tomáš Hrnčiar 2020-10-30 10:26:24 UTC
I have backported upstream PR, see: https://src.fedoraproject.org/rpms/python-isodate/pull-request/4
Builds alright in Copr with Python3.10a1 https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/1728227/

Comment 6 Miro Hrončok 2021-02-02 16:49:26 UTC
Permission to merge?

Comment 7 Ben Cotton 2021-02-09 15:20:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 8 Dan Scott 2021-02-16 04:16:54 UTC
Looks good to me. Thanks Tomáš and Miro!

Note You need to log in before you can comment on or make changes to this bug.