You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2017/08/23 20:14:02 UTC
incubator-ponymail git commit: Redundant close() call
Repository: incubator-ponymail
Updated Branches:
refs/heads/master 54e690a06 -> f85146df5
Redundant close() call
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/f85146df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/f85146df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/f85146df
Branch: refs/heads/master
Commit: f85146df5f4ab554f62edfcf5334cff5716a5ca7
Parents: 54e690a
Author: Sebb <se...@apache.org>
Authored: Wed Aug 23 21:13:58 2017 +0100
Committer: Sebb <se...@apache.org>
Committed: Wed Aug 23 21:13:58 2017 +0100
----------------------------------------------------------------------
tools/import-mbox.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f85146df/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 7901a09..a3b49a0 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -201,7 +201,7 @@ class SlurpThread(Thread):
try:
with open(filename, "rb") as bf:
bmd = bf.read()
- bf.close()
+ bf.close() # explicit early close
bmd = gzip.decompress(bmd)
tmpfile = tempfile.NamedTemporaryFile(mode='w+b', buffering=1, delete=False)
tmpfile.write(bmd)
@@ -232,7 +232,6 @@ class SlurpThread(Thread):
tmpname = hashlib.sha224(("%f-%f-%s-%s.mbox" % (random.random(), time.time(), ml, mboxfile)).encode('utf-8') ).hexdigest()
with open(tmpname, "w") as f:
f.write(inp)
- f.close()
messages = mailbox.mbox(tmpname, MboxoFactory, create=False)
count = 0