Older versions of python (I tested python 2.5) don't support the
delete=False parameter to NamedTemporaryFile(). In any case, it's not
actually a temporary file since we're not planning to delete it.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
tempname = None
if b is None:
tempname = None
if b is None:
- tf = tempfile.NamedTemporaryFile(
- dir=path, suffix='bup.bloom', delete=False)
+ tfd,tfname = tempfile.mkstemp(dir=path, suffix='bup.bloom')
+ tf = os.fdopen(tfd, 'w+')
- tf.name, f=tf, readwrite=True, expected=add_count, k=opt.k)
+ tfname, f=tf, readwrite=True, expected=add_count, k=opt.k)
count = 0
for ix in add:
progress('Writing bloom: %d/%d\r' % (count, len(add)))
count = 0
for ix in add:
progress('Writing bloom: %d/%d\r' % (count, len(add)))