This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Anthony Sottile
Recipients Anthony Sottile, beaugunderson
Date 2018-10-17.04:32:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539750721.28.0.788709270274.issue35004@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-10-17 04:32:01Anthony Sottilesetrecipients: + Anthony Sottile, beaugunderson
2018-10-17 04:32:01Anthony Sottilesetmessageid: <1539750721.28.0.788709270274.issue35004@psf.upfronthosting.co.za>
2018-10-17 04:32:01Anthony Sottilelinkissue35004 messages
2018-10-17 04:32:00Anthony Sottilecreate