Description
MoinMoin show a UnicodeDecode Error page when you request information page from the Main Page. The text output is : "'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)".
Steps to reproduce
Try: http://moinmoin.wikiwikiweb.de/MoinMoinWiki?action=info&hitcounts=1 (german OS, Browser language en)
Details
This Wiki
Workaround
Discussion
Here is a patch for 1.3.5:
--- hitcounts-1.3.5.py 2005-07-22 04:43:52.000000000 +0900 +++ hitcounts.py 2005-10-21 00:02:22.328125000 +0900 @@ -136,7 +136,7 @@ def text(pagename, request, params=''): from MoinMoin.util.dataset import TupleDataset, Column from MoinMoin.widget.browser import DataBrowserWidget - from cStringIO import StringIO + from StringIO import StringIO _ = request.getText # check params
The patch was not tested yet by moin developers
Here is a quick fix for 1.5.
1 * looking for arch@arch.thinkmo.de--2003-archives/moin--main--1.5--patch-123 to compare with
2 * comparing to arch@arch.thinkmo.de--2003-archives/moin--main--1.5--patch-123
3 M MoinMoin/stats/hitcounts.py
4
5 * modified files
6
7 --- orig/MoinMoin/stats/hitcounts.py
8 +++ mod/MoinMoin/stats/hitcounts.py
9 @@ -86,8 +86,11 @@
10
11 if event[0] <= cache_date:
12 break
13 - # XXX Bug: event[2].get('pagename') -> u'Aktuelle%C4nderungen' 8(
14 +
15 + # The log returns utf-8 ??!
16 eventpage = event[2].get('pagename','')
17 + eventpage = unicode(eventpage, config.charset)
18 +
19 if filterpage and eventpage != filterpage:
20 continue
21 time_tuple = request.user.getTime(wikiutil.version2timestamp(event[0]))
I'm not sure this is the correct place to fix this. Our internal format is Unicode, so the log should return unicode, not utf-8. It will be very hard to "fix" the log in many places. The log should accept and return only unicode strings or plain ascii. The actual internal format it save the data must be hidden from clients.
wikiutil.makeQueryString() missed want_unicode=True. May be this function behaved nicer in the past.
Plan
- Priority:
- Assigned to:
- Status: fixed in patch 146 (no, that was another fix. This one was fixed in patch-177).