# HG changeset patch # User cmlenz # Date 1181948326 0 # Node ID 78a9033b68391ee4dff2e26784020e236e2fbd09 # Parent 733cca7ff6a5ce1e1379bdf7e5ea759ead6bea2f Fix parsing of timezone in POT creation date. diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py --- a/babel/messages/catalog.py +++ b/babel/messages/catalog.py @@ -258,7 +258,8 @@ ts = time.mktime(tt) tzoffset = FixedOffsetTimezone(int(tzoffset[:2]) * 60 + int(tzoffset[2:])) - self.creation_date = datetime.fromtimestamp(ts, tzoffset) + dt = datetime.fromtimestamp(ts) + self.creation_date = dt.replace(tzinfo=tzoffset) mime_headers = property(_get_mime_headers, _set_mime_headers, doc="""\ The MIME headers of the catalog, used for the special ``msgid ""`` entry. diff --git a/babel/messages/tests/frontend.py b/babel/messages/tests/frontend.py --- a/babel/messages/tests/frontend.py +++ b/babel/messages/tests/frontend.py @@ -255,7 +255,7 @@ self.cmd.output_file = 'dummy' self.assertRaises(DistutilsOptionError, self.cmd.finalize_options) - def test_init_with_output_dir(self): + def test_with_output_dir(self): self.cmd.input_file = 'project/i18n/messages.pot' self.cmd.locale = 'en_US' self.cmd.output_dir = 'project/i18n'