Changes between Initial Version and Version 1 of Ticket #29754


Ignore:
Timestamp:
Sep 13, 2018, 5:44:19 PM (6 years ago)
Author:
Alexander Holmbäck
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29754

    • Property Summary Trunc() doesn't handle NonExistingTimeError/AmbiguousTimeErrorTrunc() doesn't handle NonExistentTimeError/AmbiguousTimeError
  • Ticket #29754 – Description

    initial v1  
    1 When `Trunc()` truncates to a nonexisting or ambiguous datetime, the exception raised by pytz remains unhandled. The expected behavior would, IMO, be to use naive datetimes for truncated dates, or adjust to closest existing non-ambiguous datetime.
     1When `Trunc()` truncates to a nonexisting or ambiguous datetime, the exception raised by pytz remains unhandled. The expected behavior would, IMO, be to not check the validity of truncated dates.
    22
    33This test for example:
     
    1313
    1414
    15 class TestTruncateToNonExistingTime(TestCase):
     15class TestTruncateToInvalidTime(TestCase):
    1616
    1717    def test_truncate_to_dst_ends_stockholm(self):
     
    2828{{{
    2929======================================================================
    30 ERROR: test_truncate_to_dst_ends_stockholm (trunc.tests.TestTruncateToNonExistingTime)
     30ERROR: test_truncate_to_dst_ends_stockholm (trunc.tests.TestTruncateInvalidTime)
    3131----------------------------------------------------------------------
    3232Traceback (most recent call last):
Back to Top