ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: size can potentially be None; don't fail if so
Date Tue, 26 Sep 2017 11:09:09 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master ebd68c8f4 -> f7a5aacfd


size can potentially be None; don't fail if so

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/f7a5aacf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/f7a5aacf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/f7a5aacf

Branch: refs/heads/master
Commit: f7a5aacfdeaf966fab59b5d5d4d7e74ba60ad4c0
Parents: ebd68c8
Author: Sebb <sebb@apache.org>
Authored: Tue Sep 26 12:09:05 2017 +0100
Committer: Sebb <sebb@apache.org>
Committed: Tue Sep 26 12:09:05 2017 +0100

----------------------------------------------------------------------
 tools/mboxo_patch.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/f7a5aacf/tools/mboxo_patch.py
----------------------------------------------------------------------
diff --git a/tools/mboxo_patch.py b/tools/mboxo_patch.py
index 20b5443..f1de613 100644
--- a/tools/mboxo_patch.py
+++ b/tools/mboxo_patch.py
@@ -58,7 +58,9 @@ class MboxoReader(mailbox._PartialFile):
         if self.remain != 0:
             super().seek(whence=1, offset=-self.remain)
         # ensure we get enough to match successfully when refilling
-        size = size if size > FROM_MANGLED_LEN else FROM_MANGLED_LEN
+        # size can be None; assume large enough if so
+        if size:
+            size = size if size > FROM_MANGLED_LEN else FROM_MANGLED_LEN
         bytes = super()._read(size, read_method)
         bufflen=len(bytes)
         # did we get anything new?


Mime
View raw message