Message327856
Here's a simpler reproduction without involving a third party library:
>>> import cProfile
>>> from datetime import timedelta
>>> pr = cProfile.Profile()
>>> timedelta.total_seconds(-25200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'total_seconds' requires a 'datetime.timedelta' object but received a 'int'
>>> pr.enable()
>>> timedelta.total_seconds(-25200)
2177366085.870893
>>> pr.disable()
>>> timedelta.total_seconds(-25200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'total_seconds' requires a 'datetime.timedelta' object but received a 'int'
However, it appears fixed on master:
$ ./python
Python 3.8.0a0 (heads/master:c984d20ec8, Oct 16 2018, 20:47:49)
[GCC 7.3.0] on linux
>>>
>>> import cProfile
>>> from datetime import timedelta
>>> pr = cProfile.Profile()
>>> timedelta.total_seconds(-25200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'total_seconds' requires a 'datetime.timedelta' object but received a 'int'
>>> pr.enable()
>>> timedelta.total_seconds(-25200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'total_seconds' for 'datetime.timedelta' objects doesn't apply to 'int' object
>>> pr.disable()
>>> timedelta.total_seconds(-25200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'total_seconds' requires a 'datetime.timedelta' object but received a 'int'
Doing a git bisect shows that this commit fixed the issue: https://github.com/python/cpython/pull/8300
Here's the bpo for that: https://bugs.python.org/issue34126 |
|
Date |
User |
Action |
Args |
2018-10-17 04:32:01 | Anthony Sottile | set | recipients:
+ Anthony Sottile, beaugunderson |
2018-10-17 04:32:01 | Anthony Sottile | set | messageid: <1539750721.28.0.788709270274.issue35004@psf.upfronthosting.co.za> |
2018-10-17 04:32:01 | Anthony Sottile | link | issue35004 messages |
2018-10-17 04:32:00 | Anthony Sottile | create | |
|