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.

作者 neoecos
收信人 Arfrever, BreamoreBoy, benjamin.peterson, doerwalter, georg.brandl, larry, loewis, neoecos, ngrig, pitrou, python-dev, serhiy.storchaka
日期 2013-03-31.19:33:12
SpamBayes Score -1.0
Marked as misclassified
Message-id <1364758394.47.0.234401183811.issue1470548@psf.upfronthosting.co.za>
In-reply-to
内容
I have been working with this in order to generate an RSS feed using web2py.

I found, XMLGenerator method does not validate if is an unicode or string type, and it does not encode accord the encoding parameter of the XMLGenerator.

I added changed the method to verify if is an unicode object or try to convert to it using the desired encoding.

Recall that the _write UnbufferedTextIOWrapper receives an unicode object as parameter.

    def characters(self, content):
        if isinstance(content, unicode):      
            self._write(escape(content))
	else:
	    self._write(escape(unicode(content,self._encoding)))
历史
日期 用户 动作 参数
2013-03-31 19:33:14neoecos修改recipients: + neoecos, loewis, doerwalter, georg.brandl, ngrig, pitrou, larry, benjamin.peterson, Arfrever, BreamoreBoy, python-dev, serhiy.storchaka
2013-03-31 19:33:14neoecos修改messageid: <1364758394.47.0.234401183811.issue1470548@psf.upfronthosting.co.za>
2013-03-31 19:33:14neoecos链接issue1470548 messages
2013-03-31 19:33:14neoecos创建