PEP-8ify a couple lines that were running off the screen.
* Also, change a logger string to say 'GnuPG' instead of the binary's name 'gpg'.testing/mmn/mktime_takes_localtime_not_gmtime
parent
e3eb7eea0c
commit
25637ef50e
|
@ -95,14 +95,16 @@ def _copy_data(instream, outstream):
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
break
|
break
|
||||||
sent += len(data)
|
sent += len(data)
|
||||||
logger.debug("_copy_data(): sending chunk (%d):\n%s" % (sent, data[:256]))
|
logger.debug("_copy_data(): sending chunk (%d):\n%s"
|
||||||
|
% (sent, data[:256]))
|
||||||
try:
|
try:
|
||||||
outstream.write(data)
|
outstream.write(data)
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
try:
|
try:
|
||||||
outstream.write(data.encode(enc))
|
outstream.write(data.encode(enc))
|
||||||
except IOError:
|
except IOError:
|
||||||
logger.exception('_copy_data(): Error sending data: Broken pipe')
|
logger.exception(
|
||||||
|
'_copy_data(): Error sending data: Broken pipe')
|
||||||
break
|
break
|
||||||
except IOError:
|
except IOError:
|
||||||
# Can get 'broken pipe' errors even when all data was sent
|
# Can get 'broken pipe' errors even when all data was sent
|
||||||
|
@ -161,7 +163,7 @@ def _find_binary(binary=None):
|
||||||
except IndexError as ie: logger.debug(ie.message)
|
except IndexError as ie: logger.debug(ie.message)
|
||||||
if binary is None:
|
if binary is None:
|
||||||
try: binary = _which('gpg')[0]
|
try: binary = _which('gpg')[0]
|
||||||
except IndexError: raise RuntimeError("gpg is not installed")
|
except IndexError: raise RuntimeError("GnuPG is not installed!")
|
||||||
try:
|
try:
|
||||||
assert os.path.isabs(binary), "Path to gpg binary not absolute"
|
assert os.path.isabs(binary), "Path to gpg binary not absolute"
|
||||||
assert not os.path.islink(binary), "Path to gpg binary is symlink"
|
assert not os.path.islink(binary), "Path to gpg binary is symlink"
|
||||||
|
|
Loading…
Reference in New Issue