[New-bugs-announce] [issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

Jean-Paul Calderone report at bugs.python.org
Thu Dec 8 18:23:11 CET 2011


New submission from Jean-Paul Calderone <invalid at example.invalid>:

When a timezone produces an out-of-bounds utc offset, the resulting exception always claims that the offset was 1440, rather than whatever it was.  Example:

from datetime import timedelta, datetime, tzinfo

class X(tzinfo):
    def utcoffset(self, time):
        return timedelta(days=2)

datetime.now(tz=X())

----------
components: Library (Lib)
messages: 149046
nosy: exarkun
priority: normal
severity: normal
status: open
title: When tzinfo.utcoffset is out-of-bounds, the exception message is misleading
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list