• Bug#1065357: parsedatetime: testNextMonth fails around February 29

    From Graham Inggs@21:1/5 to All on Sun Mar 3 12:10:01 2024
    Source: parsedatetime
    Version: 2.6-3
    Severity: important
    Tags: ftbfs
    Forwarded: https://github.com/bear/parsedatetime/issues/282

    Hi Maintainer

    testNextMonth fails around February 29. I've copied what I hope is
    the relevant part of the log below.

    Regards
    Graham


    287s =================================== FAILURES ===================================
    287s ______________________________ test.testNextMonth ______________________________
    287s
    287s self = <tests.TestSimpleOffsets.test testMethod=testNextMonth>
    287s
    287s def testNextMonth(self):
    287s s = (datetime.datetime(self.yr, self.mth, self.dy,
    287s self.hr, self.mn, self.sec) +
    287s datetime.timedelta(days=1))
    287s t = self.cal.inc(s, year=1)
    287s
    287s start = s.timetuple()
    287s target = t.timetuple()
    287s
    287s phrase = 'next %s %s' % (calendar.month_name[t.month], t.day)
    287s
    287s > self.assertEqual(_tr(self.cal.parse(phrase, start)),
    287s _tr((target, 1)))
    287s E AssertionError: Tuples differ: ((2026, 2, 28, 20, 42, 0,
    0, 0, 0), 1) != ((2025, 2, 28, 20, 42, 0, 0, 0, 0), 1)
    287s E
    287s E First differing element 0:
    287s E (2026, 2, 28, 20, 42, 0, 0, 0, 0)
    287s E (2025, 2, 28, 20, 42, 0, 0, 0, 0)
    287s E
    287s E - ((2026, 2, 28, 20, 42, 0, 0, 0, 0), 1)
    287s E ? ^
    287s E
    287s E + ((2025, 2, 28, 20, 42, 0, 0, 0, 0), 1)
    287s E ? ^
    287s
    287s tests/TestSimpleOffsets.py:251: AssertionError

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)