Avoid writing raw encrypted bytes to terminal debug loggers.

fix/102-py3k-decrypt-bytes-literal
Isis Lovecruft 2015-03-18 19:39:22 +00:00
parent fea39ec83e
commit a749acf486
No known key found for this signature in database
GPG Key ID: 18C16EC5F9F1D673
1 changed files with 4 additions and 1 deletions

View File

@ -1001,7 +1001,10 @@ class GPGBase(object):
result = self._result_map['crypt'](self) result = self._result_map['crypt'](self)
log.debug("Got data '%s' with type '%s'." % (data, type(data))) log.debug("Got data '%s' with type '%s'." % (data, type(data)))
self._handle_io(args, data, result, passphrase=passphrase, binary=True) self._handle_io(args, data, result, passphrase=passphrase, binary=True)
log.debug("\n%s" % result.data) # Avoid writing raw encrypted bytes to terminal loggers and breaking
# them in that adorable way where they spew hieroglyphics until reset:
if armor:
log.debug("\n%s" % result.data)
if output_filename: if output_filename:
log.info("Writing encrypted output to file: %s" % output_filename) log.info("Writing encrypted output to file: %s" % output_filename)