Check that _copy_data() parameters are actually file descriptors.
* Closes #1920.feature/documentation-builds-dirhtml
parent
951fafb5e3
commit
3c925e997e
7
gnupg.py
7
gnupg.py
|
@ -100,6 +100,13 @@ def _copy_data(instream, outstream):
|
||||||
"""
|
"""
|
||||||
sent = 0
|
sent = 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
assert isinstance(instream, file), "instream is not a file"
|
||||||
|
assert isinstance(outsteam, file), "outstream is not a file"
|
||||||
|
except AssertionError:
|
||||||
|
logger.exception(exc_info=1)
|
||||||
|
return
|
||||||
|
|
||||||
if hasattr(sys.stdin, 'encoding'):
|
if hasattr(sys.stdin, 'encoding'):
|
||||||
enc = sys.stdin.encoding
|
enc = sys.stdin.encoding
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue