[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/ Fixed a time zone dependency. connectionDebugInfo() now speaks UTC.

Shane Hathaway shane at hathawaymix.org
Tue Dec 9 20:20:42 EST 2008


Log message for revision 93832:
  Fixed a time zone dependency.  connectionDebugInfo() now speaks UTC.
  

Changed:
  U   ZODB/trunk/src/ZODB/DB.py
  U   ZODB/trunk/src/ZODB/tests/testDB.py

-=-
Modified: ZODB/trunk/src/ZODB/DB.py
===================================================================
--- ZODB/trunk/src/ZODB/DB.py	2008-12-10 01:19:32 UTC (rev 93831)
+++ ZODB/trunk/src/ZODB/DB.py	2008-12-10 01:20:42 UTC (rev 93832)
@@ -757,9 +757,10 @@
                 d = ''
             d = "%s (%s)" % (d, len(c._cache))
 
+            # output UTC time with the standard Z time zone indicator
             result.append({
                 'opened': o and ("%s (%.2fs)" % (
-                    time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(o)),
+                    time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(o)),
                     t-o)),
                 'info': d,
                 'before': c.before,

Modified: ZODB/trunk/src/ZODB/tests/testDB.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testDB.py	2008-12-10 01:19:32 UTC (rev 93831)
+++ ZODB/trunk/src/ZODB/tests/testDB.py	2008-12-10 01:20:42 UTC (rev 93832)
@@ -134,10 +134,10 @@
     >>> pprint.pprint(sorted(info, key=lambda i: str(i['opened'])), width=1)
     [{'before': None,
       'info': 'test info (2)',
-      'opened': '2008-12-04T15:40:44 (1.40s)'},
+      'opened': '2008-12-04T20:40:44Z (1.40s)'},
      {'before': '\x03zY\xd8\xc0m9\xdd',
       'info': ' (0)',
-      'opened': '2008-12-04T15:40:45 (0.30s)'},
+      'opened': '2008-12-04T20:40:45Z (0.30s)'},
      {'before': None,
       'info': ' (0)',
       'opened': None}]



More information about the Zodb-checkins mailing list