Commits

Peter Suter  committed bb30894

1.1.1dev: Slightly more robust handling of really old dates.
`time.mktime()` can raise `ValueError` or `OverflowError` depending no platform / date. On Windows for example, dates before 1900 raise `ValueError`, dates between 1900 and 1970 raise `OverflowError`.

(See also http://bugs.python.org/issue1777412 for a related but unsolved problem where `datetime.strftime()` dislikes years before 1900, too.)

  • Participants
  • Parent commits d556e23

Comments (0)

Files changed (1)

File trac/util/datefmt.py

             return tt.tm_isdst > 0
         except OverflowError:
             return False
+        except ValueError:
+            return False
 
     def localize(self, dt, is_dst=False):
         if dt.tzinfo is not None: