buffering=1 not allowed with binary files
This fixes #534
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 056904a..f0217e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## Changes in 0.12:
+- Bug: buffering=1 not allowed with binary files (#534)
- Bug: Invalid mailing list address supplied (#516)
- Enh: stats.lua could return monthly stats to show in calendar (#532)
- Bug: archiver.py msgbody() function issues (#244 and #463)
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 28c0363..59f94f8 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -161,7 +161,7 @@
bmd = bf.read()
bf.close() # explicit early close
bmd = gzip.decompress(bmd)
- tmpfile = tempfile.NamedTemporaryFile(mode='w+b', buffering=1, delete=False)
+ tmpfile = tempfile.NamedTemporaryFile(mode='w+b', delete=False)
tmpfile.write(bmd)
tmpfile.flush()
tmpfile.close()
@@ -514,7 +514,7 @@
for mlist in re.finditer(ns, data):
ml = mlist.group(1)
mldata = urlopen("%s%s" % (source, ml)).read()
- tmpfile = tempfile.NamedTemporaryFile(mode='w+b', buffering=1, delete=False)
+ tmpfile = tempfile.NamedTemporaryFile(mode='w+b', delete=False)
try:
if ml.find(".gz") != -1:
mldata = gzip.decompress(mldata)