Description

FindPage cannot be opened at all.

Wiki will fail with the following message in the log:

ERROR 2010-06-08 18:30:00,990 MoinMoin.macro:132 Macro AdvancedSearch (page: 'FindPage') raised an exception:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/MoinMoin/macro/__init__.py", line 122, in execute
    return execute(self, args)
  File "/usr/lib/python2.6/site-packages/MoinMoin/macro/AdvancedSearch.py", line 189, in execute
    return advanced_ui(macro)
  File "/usr/lib/python2.6/site-packages/MoinMoin/macro/AdvancedSearch.py", line 141, in advanced_ui
    (_('File Type'), unicode(mt_select), ''),
  File "/usr/lib/python2.6/site-packages/MoinMoin/widget/html.py", line 131, in __unicode__
    co = unicode(c)
  File "/usr/lib/python2.6/site-packages/MoinMoin/widget/html.py", line 131, in __unicode__
    co = unicode(c)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3: ordinal not in range(128)

Steps to reproduce

  1. Try to access FindPage.

Component selection

I checked the code a little bit and found out that /etc/mime.types in Fedora 13 cannot get parsed.

This is because there is "cubic" sign (g3) on one of the mime types.

application/vnd.geocube+xml                     g3 g³

This is line 355 of Fedora 13's /etc/mime.types

Details

MoinMoin Version

1.9.2

OS and Version

Fedora 13

Python Version

2.6

Server Setup

Fedora 13 Desktop Edition

Server Details

nothing specific

Language you are using the wiki in (set in the browser/UserPreferences)

en

Workaround

Delete g³ from /etc/mime.types (or any other non-ascii entry).

Discussion

uncleremus, 2012-05-25: Here is another patch that might be in the "right place". Tested on my Fedora system (F16).

I'ld suggest considering that "to-the-power-of-3" utf-8 char in /etc/mime.types to be the bug, until otherwise proven that mime.types has to be considered a file with utf-8 contents. There's no single encode/decode operation in python's mimetypes.py stdlib module, so to me it rather looks like that file has to be ascii. Also, using non-ascii filename extensions looks like a pretty bad idea considering the different encodings used on different systems/platforms. Thus, please file a bug to fedora, I'm closing this one until more evidence has been shown. -- ThomasWaldmann 2012-05-26 16:42:59

Note: I sent an email to the person who registered that mimetype and provided the non-ascii extension within that registration to either show specs allowing that or remove the non-ascii extension. Let's see what happens. -- ThomasWaldmann 2012-05-26 17:19:29

Update: got a reply:

Francois Pirsch told that

While answering his email, I also had a look at python 3.3: stdlib mimetypes.py there uses "utf-8" decoding for the mime.types file (not sure where THEY got it from or whether it was just a wild guess). Python 2.x does not do that, though, so this won't help us.

So I guess (although it is not a moin bug) we need a workaround to avoid the crash on all platforms / pythons that have troubles with that non-ascii mime.types content.

See also: http://bugs.python.org/issue13025 (the "fix" is in python 3.x)

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/FindPage (last edited 2012-05-27 19:39:25 by ThomasWaldmann)