Rolf Krahl added the comment:

Thanks for your review!  Here comes a new version of the patch.  I believe I 
addressed all review comments.

Since I didn't get any feedback on my questions raised above, I resolved them 
as follows:

1. I dropped the EncodingError exception introduced by an earlier version of 
the patch by Damien.  This error is raised when the caller sets an illegal 
combination of headers.  Since the error does not occur as a result of talking 
to the HTTP server, I think an HTTPException or a child thereof is just wrong.  
A ValueError is more appropriate here and that is what the code raises now.

2. I changed the test whether a file-like is a text stream to isText = 
isinstance(readable.read(0), str).  This relies only on the read() method and 
is the most generic test.  The original code would fail for StringIO and other 
text streams that do not have the mode attribute.  Note that I needed to fix a 
test that violated the file object protocol with a read() method that ignored 
the size parameter.

----------
Added file: http://bugs.python.org/file43973/issue12319_9.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to