Merge remote-tracking branch 'mmn/file_and_io_handling_diff' into develop
* ADD patch by Mikael Nordfeldth to file python3 syntax compatibility due to the 'file' builtin being removed. isinstance(foo, file) → hasattr(foo, 'read'), or, file = _io._IOBase * CLOSES issue #13. https://github.com/isislovecruft/python-gnupg/pull/13fix/24-enc-to-file
commit
1d22ce5adb
|
@ -186,7 +186,7 @@ class GPG(GPGBase):
|
|||
else:
|
||||
log.warn("No 'default_key' given! Using first key on secring.")
|
||||
|
||||
if isinstance(data, file):
|
||||
if hasattr(data, 'read'):
|
||||
result = self._sign_file(data, **kwargs)
|
||||
elif not _is_stream(data):
|
||||
stream = _make_binary_stream(data, self._encoding)
|
||||
|
|
Loading…
Reference in New Issue