bup-fsck checks for the availability of par2's -t1 option by executing
it (for the reason see
dc10c9172e1197c77c246ea75aae63388dcd641e). If
the option is unavailable, par2 returns an error ("Invalid option
specified: -t1") which is not muted by the -qq option.
To hide this harmless par2 error during bup-fsck invocations the
subprocess call needs to capture stderr.
Signed-off-by: Gernot Schulz <post@gernot-schulz.com>
[rlb@defaultvalue.org: expand abbreviated hash to full hash above]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
canary = tmpdir + '/canary'
with open(canary, 'w') as f:
print('canary', file=f)
- rc = call(('par2', 'create', '-qq', '-t1', canary))
+ p = subprocess.Popen(['par2', 'create', '-qq', '-t1', canary],
+ stdout=nullf, stderr=nullf, stdin=nullf)
+ rc = p.wait()
return rc == 0
finally:
rmtree(tmpdir)