Fix documentation in function _copy_data(). WONTFIX hanging FD problem #1921

* Won't fix hanging file descriptor problem due to this problem requiring a
   complete rewrite of nearly every function in the module.
 * Closes #1921, #1927, #1929.
 * Fix whitespace styling.
feature/documentation-builds-dirhtml
Isis Lovecruft 2013-03-06 17:11:57 +00:00
parent 6398ddcf28
commit 6074a24c0b
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 8 additions and 1 deletions

View File

@ -92,12 +92,19 @@ if not logger.handlers:
logger.addHandler(NullHandler())
def _copy_data(instream, outstream):
# Copy one stream to another
"""
Copy data from one stream to another.
@param instream: A file descriptor to read from.
@param outstream: A file descriptor to write to.
"""
sent = 0
if hasattr(sys.stdin, 'encoding'):
enc = sys.stdin.encoding
else:
enc = 'ascii'
while True:
data = instream.read(1024)
if len(data) == 0: