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/13
fix/24-enc-to-file
Isis Lovecruft 2013-07-29 20:57:25 +00:00
commit 1d22ce5adb
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 1 additions and 1 deletions

View File

@ -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)