[Zope3-checkins] SVN: Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/ fix timezone related bug in handling of the last

Michael Kerrin michael.kerrin at openapp.biz
Fri Feb 24 15:55:55 EST 2006


Log message for revision 41780:
  fix timezone related bug in handling of the last
  modified time
  

Changed:
  U   Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/ftp.py
  U   Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/tests/test_zope_ftp.py

-=-
Modified: Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/ftp.py
===================================================================
--- Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/ftp.py	2006-02-24 20:18:28 UTC (rev 41779)
+++ Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/ftp.py	2006-02-24 20:55:54 UTC (rev 41780)
@@ -15,7 +15,7 @@
 """
 __docformat__="restructuredtext"
 
-import time
+import calendar
 from cStringIO import StringIO
 from types import StringTypes
 
@@ -232,7 +232,7 @@
     def _list_modified(self, value):
         mtime = value.get('mtime', None)
         if mtime:
-            return int(time.mktime(mtime.utctimetuple()))
+            return calendar.timegm(mtime.utctimetuple())
         return 0
 
     def _list_permissions(self, value):

Modified: Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/tests/test_zope_ftp.py
===================================================================
--- Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/tests/test_zope_ftp.py	2006-02-24 20:18:28 UTC (rev 41779)
+++ Zope3/branches/mkerrin-remove_trial_tests/src/zope/app/twisted/ftp/tests/test_zope_ftp.py	2006-02-24 20:55:54 UTC (rev 41780)
@@ -63,6 +63,8 @@
 
 class FTPServerTestCase(test_ftp.FTPServerTestCase):
     def tearDown(self):
+        ## Uninstall the monkey patches needed to get the tiral tests
+        ## running successfully within the zope test runner.
         test_zopetrial.tearDown()
 
         # Clean up sockets
@@ -74,6 +76,10 @@
         del self.serverProtocol
 
     def setUp(self):
+        ## Install monkey patches in the test_zopetrail module that
+        ## allow me to cleanly test the Twisted server code from within
+        ## the Zope test runner.
+        ## Don't forget to call test_zopetrial.tearDown
         test_zopetrial.setUp()
 
         root = demofs.Directory()



More information about the Zope3-Checkins mailing list