Patch[2] for http_response.py for quixote-2.1 (_encode_chunk)

Hamish Lawson <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
I'd like to add my support for Damjan's patch:

"This patch for Quixote-2.1/http_response.py changes the
HTTPResponse._encode_chunk method to only call the .encode method on
unciode objects, otherwise assume the programer knows what he does and
just send the byte string as is."

Quixote has no way of knowing how a str object has been encoded. When
the response's character set is set to iso-8959-1, Quixote can't know
whether the returned string has actually been encoded accordingly; and
for any other character set, Quixote can't know whether a returned str
object has in fact been encoded in ASCII (at best it can only
determine whether its bytes fall in the range 0x00 to 0x7F). It
therefore doesn't make sense to let a str object pass as is only when
the character set for the response is set to iso-8959-1.


Hamish Lawson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.