Re: RELEASED: Quixote-2.1, and updates of other packages.

Damjan <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
> On behalf of the MEMS Exchange, I am pleased to announce
> the release of Quixote 2.1.
> http://www.mems-exchange.org/software/quixote/

It still has this stupid function in http_response.py

    def _encode_chunk(self, chunk):
        """(chunk : str | unicode) -> str
        """
        if self.charset == 'iso-8859-1' and isinstance(chunk, str):
            return chunk # non-ASCII chars are okay
        else:
            return chunk.encode(self.charset)

so in the case of self.charset == 'utf8' and chunk is a 'str' instance,
you are calling chunk.encode ('utf8') on a str object.. which fails in
most cases you'd set self.charset to be utf8. I already proposed this
much better function some months ago:

    def _encode_chunk(self, chunk):
        """(chunk : str | unicode) -> str
        """
        if isinstance(chunk, unicode):
            return chunk.encode(self.charset)
        else:
            return chunk # non-ASCII chars are okay

..encode has real meaning on unicode objects

-- 
damjan | дамјан
This is my jabber ID --> [email protected] <-- not my mail address!!!
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.