]> code.delx.au - offlineimap/commitdiff
Handle rtime being Null when writing to Maildir
authorJohn Goerzen <jgoerzen@complete.org>
Sat, 2 Dec 2006 20:54:26 +0000 (21:54 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Sat, 2 Dec 2006 20:54:26 +0000 (21:54 +0100)
fixes #2
debian #401290

offlineimap/folder/Maildir.py

index 7e1877cd1f982fc5161fe4ec03fa0b542c213adb..74019cb658331a8338fac0e73559b5068ec15d16 100644 (file)
@@ -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),