changeset 121:78a9033b6839

Fix parsing of timezone in POT creation date.
author cmlenz
date Fri, 15 Jun 2007 22:58:46 +0000
parents 733cca7ff6a5
children bfe7357a4754
files babel/messages/catalog.py babel/messages/tests/frontend.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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'
Copyright (C) 2012-2017 Edgewall Software