]> code.delx.au - offlineimap/blobdiff - offlineimap/folder/Maildir.py
Handle rtime being Null when writing to Maildir
[offlineimap] / offlineimap / folder / Maildir.py
index 6d61c3d08e957618664b413d3208761bc5867939..74019cb658331a8338fac0e73559b5068ec15d16 100644 (file)
@@ -1,5 +1,5 @@
 # Maildir folder support
-# Copyright (C) 2002 John Goerzen
+# Copyright (C) 2002 - 2006 John Goerzen
 # <jgoerzen@complete.org>
 #
 #    This program is free software; you can redistribute it and/or modify
@@ -170,7 +170,8 @@ class MaildirFolder(BaseFolder):
         file = open(os.path.join(tmpdir, tmpmessagename), "wt")
         file.write(content)
         file.close()
-        os.utime(os.path.join(tmpdir,tmpmessagename), (rtime,rtime))
+        if rtime != None:
+            os.utime(os.path.join(tmpdir,tmpmessagename), (rtime,rtime))
         ui.debug('maildir', 'savemessage: moving from %s to %s' % \
                  (tmpmessagename, messagename))
         os.link(os.path.join(tmpdir, tmpmessagename),