out, err = p.communicate(input=input)
if check and p.returncode != 0:
raise Exception('subprocess %r failed with status %d%s'
out, err = p.communicate(input=input)
if check and p.returncode != 0:
raise Exception('subprocess %r failed with status %d%s'
(', stderr: %r' % err) if err else ''))
return ex_res(out=out, err=err, proc=p, rc=p.returncode)
def logcmd(cmd):
(', stderr: %r' % err) if err else ''))
return ex_res(out=out, err=err, proc=p, rc=p.returncode)
def logcmd(cmd):
- if isinstance(cmd, basestring):
- print(cmd, file=sys.stderr)
+ s = helpers.shstr(cmd)
+ if isinstance(cmd, str_type):
+ print(s, file=sys.stderr)
- print(' '.join(map(quote, cmd)), file=sys.stderr)
+ # bytes - for now just continue to pass it through given
+ # bup-python wrapper
+ print(s.decode('iso-8859-1'), file=sys.stderr)