Check that _copy_data() parameters are actually file descriptors.

* Closes #1920.
feature/documentation-builds-dirhtml
Isis Lovecruft 2013-03-06 17:49:44 +00:00
parent 951fafb5e3
commit 3c925e997e
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,13 @@ def _copy_data(instream, outstream):
"""
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'):
enc = sys.stdin.encoding
else: