This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Rotkraut
Recipients Rotkraut, demian.brecht, harobed, martin.panter, orsenthil, petri.lehtinen, piotr.dobrogost, pitrou, whitemice
Date 2016-08-02.11:36:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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(, 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.
Date User Action Args
2016-08-02 11:36:59Rotkrautsetrecipients: + Rotkraut, orsenthil, pitrou, harobed, petri.lehtinen, martin.panter, piotr.dobrogost, demian.brecht, whitemice
2016-08-02 11:36:58Rotkrautsetmessageid: <>
2016-08-02 11:36:58Rotkrautlinkissue12319 messages
2016-08-02 11:36:57Rotkrautcreate