1. edgewall
  2. Trac


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
  • Branches trunk

Comments (0)

Files changed (1)

File trac/util/datefmt.py

View file
             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: