def _generate_create_date(self):
if self.timezone is not None:
- tzinfo = tz.gettz(self.timezone.upper())
+ # First, assume correct capitalization
+ tzinfo = tz.gettz(self.timezone)
+ if tzinfo is None:
+ # Fall back to uppercase
+ tzinfo = tz.gettz(self.timezone.upper())
if tzinfo is None:
raise util.CommandError(
"Can't locate timezone: %s" % self.timezone)
--- /dev/null
+.. change::
+ :tags: bug, commands
+
+ Fixed bug in timezone feature introduced in
+ :ticket:`425` when the creation
+ date in a revision file is calculated, to
+ accommodate for timezone names that contain
+ mixed-case characters in their name as opposed
+ to all uppercase. Pull request courtesy Nils
+ Philippsen.
2012, 7, 25, 15, 8, 5, tzinfo=tz.gettz('UTC'))
)
+ def test_custom_tzdata_tz(self):
+ self._test_tz(
+ 'Europe/Berlin',
+ datetime.datetime(2012, 7, 25, 15, 8, 5),
+ datetime.datetime(
+ 2012, 7, 25, 17, 8, 5, tzinfo=tz.gettz('Europe/Berlin'))
+ )
+
def test_default_tz(self):
self._test_tz(
None,