Description
Upon fetching http://moinmoin.wikiwikiweb.de/HelpOnActions?action=rss_rc , I got:
UnicodeDecodeError'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) Please include this information in your bug reports!: Python Python 2.3.3: /usr/bin/python2.3 Linux thinkmo 2.4.24-thinkmo-1 #2 Mon Jan 5 18:04:00 CET 2004 i686 MoinMoin Release 1.2.1 [Revision 1.184] Mon May 3 07:33:46 2004 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /home/twaldmann/moincvs/moin-1.2/MoinMoin/request.py in run(self=<MoinMoin.request.RequestTwisted instance>) 454 else: 455 try: 456 cgitb.Hook(file=self).handle(saved_exc) 457 # was: cgitb.handler() 458 except: cgitb = <module 'MoinMoin.support.cgitb' from '/home/twaldmann/moincvs/moin-1.2/MoinMoin/support/cgitb.pyc'>, cgitb.Hook = <class MoinMoin.support.cgitb.Hook>, file undefined, self = <MoinMoin.request.RequestTwisted instance>, ).handle undefined, saved_exc = (<class exceptions.UnicodeDecodeError>, <exceptions.UnicodeDecodeError instance>, <traceback object>) /home/twaldmann/moincvs/moin-1.2/MoinMoin/action/rss_rc.py in execute(pagename='HelpOnActions', request=<MoinMoin.request.RequestTwisted instance>) 137 138 # general attributes 139 handler.simpleNode('title', item.pagename) 140 if ddiffs: 141 handler.simpleNode('link', link+"?action=diff") handler = <MoinMoin.wikixml.util.RssGenerator instance>, handler.simpleNode = <bound method RssGenerator.simpleNode of <MoinMoin.wikixml.util.RssGenerator instance>>, item = <MoinMoin.logfile.editlog.EditLogLine instance>, item.pagename = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2' /home/twaldmann/moincvs/moin-1.2/MoinMoin/wikixml/util.py in simpleNode(self=<MoinMoin.wikixml.util.RssGenerator instance>, tag='title', value='\xd0\xf3\xf1\xd2\xe5\xf1\xf2', attr={}) 39 self.startNode(tag, attr) 40 if value: 41 self.characters(value) 42 # was: self.characters(unicode(value, config.charset)) 43 self.endNode(tag) self = <MoinMoin.wikixml.util.RssGenerator instance>, self.characters = <bound method RssGenerator.characters of <MoinMoin.wikixml.util.RssGenerator instance>>, value = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2' /usr/lib/python2.3/site-packages/_xmlplus/sax/saxutils.py in characters(self=<MoinMoin.wikixml.util.RssGenerator instance>, content='\xd0\xf3\xf1\xd2\xe5\xf1\xf2') 299 300 def characters(self, content): 301 writetext(self._out, content) 302 303 def ignorableWhitespace(self, content): global writetext = <function writetext>, self = <MoinMoin.wikixml.util.RssGenerator instance>, self._out = <encodings.latin_1.StreamWriter instance>, content = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2' /usr/lib/python2.3/site-packages/_xmlplus/sax/saxutils.py in writetext(stream=<encodings.latin_1.StreamWriter instance>, text='\xd0\xf3\xf1\xd2\xe5\xf1\xf2', entities={}) 178 def writetext(stream, text, entities={}): 179 stream.errors = "xmlcharrefreplace" 180 stream.write(escape(text, entities)) 181 stream.errors = "strict" 182 else: stream = <encodings.latin_1.StreamWriter instance>, stream.write = <bound method StreamWriter.write of <encodings.latin_1.StreamWriter instance>>, global escape = <function escape>, text = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2', entities = {} /usr/lib/python2.3/codecs.py in write(self=<encodings.latin_1.StreamWriter instance>, object='\xd0\xf3\xf1\xd2\xe5\xf1\xf2') 176 """ Writes the object's contents encoded to self.stream. 177 """ 178 data, consumed = self.encode(object, self.errors) 179 self.stream.write(data) 180 data undefined, consumed undefined, self = <encodings.latin_1.StreamWriter instance>, self.encode = <built-in function latin_1_encode>, object = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2', self.errors = 'xmlcharrefreplace' UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) __doc__ = 'Unicode decoding error.' __getitem__ = <bound method UnicodeDecodeError.__getitem__ of <exceptions.UnicodeDecodeError instance>> __init__ = <bound method UnicodeDecodeError.__init__ of <exceptions.UnicodeDecodeError instance>> __module__ = 'exceptions' __str__ = <bound method UnicodeDecodeError.__str__ of <exceptions.UnicodeDecodeError instance>> args = ('ascii', '\xd0\xf3\xf1\xd2\xe5\xf1\xf2', 0, 1, 'ordinal not in range(128)') encoding = 'ascii' end = 1 object = '\xd0\xf3\xf1\xd2\xe5\xf1\xf2' reason = 'ordinal not in range(128)' start = 0
Example
(see above)
Details
This wiki.
Discussion
This is a configuration problem. The rss_rc action uses config.charset as target encoding. Obviously it was set to ascii which is a very bad idea if you want to encode non ascii characters. Encoding is UTF-8 now, which solved the problem
Sure that fixes it? It is a DECODE error, this rather means that an (implicitely done) decoding of a str (which python usually does using the ascii decoder) failed. This happens if at some place it needs a unicode object, but only has a str. And as you see, there was already a fix there, using unicode(), but obviously this broke it in another way and thus was commented again.