[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-18 Thread R. David Murray
R. David Murray added the comment: Janzert: Thanks for the patch. A contributor agreement is not needed for this patch, since it just moves code around, but you might want to submit one in case you make any other contributions. Also let us know what name to use in the Misc/ACKS file.

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-18 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 68e5e416e8af by R David Murray in branch '3.3': #19037: adjust file times *before* moving maildir files into place. http://hg.python.org/cpython/rev/68e5e416e8af New changeset 041caa64486b by R David Murray in branch '2.7': #19037: adjust file

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-18 Thread janzert
janzert added the comment: Thanks for committing the fix. Figured I should finally get it done and signed the online CLA when I submitted this issue. I assume it just takes a while for someone to go through and apply the appropriate flag? This change seems rather insubstantial for an ACKS

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-16 Thread janzert
New submission from janzert: The Maildir.add and Maildir.__setitem__ methods in the mailbox module attempts to change the file mtime after moving the file into the new directory. This allows a race condition since other programs are can move or otherwise modify the file as soon as it is

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-16 Thread R. David Murray
R. David Murray added the comment: That sounds reasonable. Would you be interested in trying your hand at a patch, ideally with a test? -- components: +email nosy: +barry, r.david.murray ___ Python tracker rep...@bugs.python.org

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-16 Thread janzert
janzert added the comment: I can certainly write a patch if wanted. It should be simply moving and modifying two lines in each of the two methods. My understanding is that it should be against 2.7 so it can be applied there first then merged forward? Unfortunately while I can consistently

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-16 Thread R. David Murray
R. David Murray added the comment: Hopefully a 2.7 patch would also apply to 3.3, so yes, start there. For the test, I was thinking that in 3.3+ we could use mock to introduce a delay. But looking at the code again it isn't obvious that there is a meaningful way to do it that is worth the

[issue19037] mailbox module modifies maildir file times after moving from tmp directory

2013-09-16 Thread janzert
Changes by janzert janz...@janzert.com: -- keywords: +patch Added file: http://bugs.python.org/file31802/mailbox.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19037 ___