[New-bugs-announce] [issue31293] crashes in multiply_float_timedelta() and in truedivide_timedelta_float()

Oren Milman report at bugs.python.org
Mon Aug 28 10:36:40 EDT 2017


New submission from Oren Milman:

both of the following true division and multiplication operations crash the
interpreter:

import datetime

class BadFloat(float):
    def as_integer_ratio(self):
        return (1 << 1000) - 1

datetime.timedelta() / BadFloat()
datetime.timedelta() * BadFloat()


this is because both multiply_float_timedelta() and truedivide_timedelta_float()
(in Modules/_datetimemodule.c) assume as_integer_ratio() returns tuple.

----------
components: Interpreter Core
messages: 300954
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crashes in multiply_float_timedelta() and in truedivide_timedelta_float()
type: crash
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31293>
_______________________________________


More information about the New-bugs-announce mailing list