= Description = At the momemt PageHits fails on this wiki because of {{{ 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)}}} -- ReimarBauer [[DateTime(2005-11-01T07:39:09Z)]] == Steps to reproduce == Select on this wiki PageHits {{{ 1023 # Visit pagename 1024 self.page = Page(self, pagename) 1025 self.page.send_page(self, count_hit=1) 1026 1027 # generate page footer (actions that do not want this footer self = self.page = self.page.send_page = > count_hit undefined /org/moin_tw/moin-1.5/MoinMoin/Page.py in send_page (self=, request=, msg='', **keywords={'count_hit': 1}) 1209 format_args=pi_formatargs, 1210 do_cache=do_cache, 1211 start_line=pi_lines) 1212 1213 # check for pending footnotes start_line undefined pi_lines = 9 /org/moin_tw/moin-1.5/MoinMoin/Page.py in send_page_content (self=, request=, Parser=, body=u'This page shows how often a page was requested s...ligence, every view counts as hit.\n\n[[PageHits]]\n', format_args=u'', do_cache=1, **kw={'start_line': 9}) 1293 try: 1294 code = self.loadCache(request) 1295 self.execute(request, parser, code) 1296 except 'CacheNeedsUpdate': 1297 try: self = self.execute = > request = parser = code = /org/moin_tw/moin-1.5/MoinMoin/Page.py in execute (self=, request=, parser=, code=) 1318 if hasattr(MoinMoin, '__loader__'): 1319 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy') 1320 exec code 1321 1322 def loadCache(self, request): code = /srv/de.wikiwikiweb.moinmaster/bin15/PageHits in ? /org/moin_tw/moin-1.5/MoinMoin/formatter/base.py in macro (self=, macro_obj=, name=u'PageHits', args=None) 279 def macro(self, macro_obj, name, args): 280 # call the macro 281 return macro_obj.execute(name, args) 282 283 def _get_bang_args(self, line): macro_obj = macro_obj.execute = > name = u'PageHits' args = None /org/moin_tw/moin-1.5/MoinMoin/wikimacro.py in execute (self=, macro_name=u'PageHits', args=None) 118 else: 119 raise ImportError("Cannot load macro %s" % macro_name) 120 return execute(self, args) 121 122 def _m_lang(self, text): execute = self = args = None /org/moin_tw/moin-1.5/MoinMoin/macro/PageHits.py in execute (macro=, args=None) 102 return ''.join(result) 103 104 105 def execute(macro, args): 106 return PageHits(macro, args).execute() global PageHits = macro = args = None ).execute undefined /org/moin_tw/moin-1.5/MoinMoin/macro/PageHits.py in execute (self=) 32 """ Execute the macro and return output """ 33 cacheDate, hits = self.cachedHits() 34 self.addHitsFromLog(hits, cacheDate) 35 self.filterReadableHits(hits) 36 hits = [(hits[pagename], pagename) for pagename in hits] self = self.addHitsFromLog = > hits = {u'!': 1, u'"': 2, u'""': 1, u'""+': 1, u'"%(backup url)s/"': 1, u'"%(link)s/"': 1, u'"/wiki/rightsidebar/img/moin-www.png/"': 16, u'"/\u7f51\u9875\u5206\u7c7b': 1, u'">MoinMoi': 4, u'"AideTemplate ["Mod\xe8leDePageD\'Aide"': 2, ...} cacheDate = 1130782832000000L /org/moin_tw/moin-1.5/MoinMoin/macro/PageHits.py in addHitsFromLog (self=, hits={u'!': 1, u'"': 2, u'""': 1, u'""+': 1, u'"%(backup url)s/"': 1, u'"%(link)s/"': 1, u'"/wiki/rightsidebar/img/moin-www.png/"': 16, u'"/\u7f51\u9875\u5206\u7c7b': 1, u'">MoinMoi': 4, u'"AideTemplate ["Mod\xe8leDePageD\'Aide"': 2, ...}, cacheDate=1130782832000000L) 63 break 64 page = event[2].get('pagename', None) 65 page = page.decode(config.charset) 66 if page: 67 hits[page] = hits.get(page, 0) + 1 page = u'\u5e2e\u52a9-\u5b8f/MailTo' page.decode = global config = config.charset = 'utf-8' /usr/local/lib/python2.4/encodings/utf_8.py in decode (input=u'\u5e2e\u52a9-\u5b8f/MailTo', errors='strict') 14 15 def decode(input, errors='strict'): 16 return codecs.utf_8_decode(input, errors, True) 17 18 class StreamWriter(codecs.StreamWriter): global codecs = codecs.utf_8_decode = input = u'\u5e2e\u52a9-\u5b8f/MailTo' errors = 'strict' builtin True = True UnicodeEncodeError 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) args = ('ascii', u'\u5e2e\u52a9-\u5b8f/MailTo', 0, 2, 'ordinal not in range(128)') encoding = 'ascii' end = 2 object = u'\u5e2e\u52a9-\u5b8f/MailTo' reason = 'ordinal not in range(128)' start = 0 }}} == Details == This Wiki == Workaround == ## How to deal with the bug until it is fixed = Discussion = = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: * Status: fixed in moin--main--1.5--patch-182 ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinBugFixed