Patchwork D10505: mail: add a TODO about proper mbox locking

login
register
mail settings
Submitter phabricator
Date April 21, 2021, 3:31 a.m.
Message ID <differential-rev-PHID-DREV-bmwbvod3esimh57qxdfp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48822/
State Superseded
Headers show

Comments

phabricator - April 21, 2021, 3:31 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Per @nbjoerg in IRC, the mbox isn't locked correctly.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10505

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -220,6 +220,7 @@ 
 
 def _mbox(mbox, sender, recipients, msg):
     '''write mails to mbox'''
+    # TODO: use python mbox library for proper locking
     with open(mbox, b'ab+') as fp:
         # Should be time.asctime(), but Windows prints 2-characters day
         # of month instead of one. Make them print the same thing.