Description

Using the MoinMoin Desktop Engine running as moin.exe in servermode (on Xp, 2000, 2003, all three tested) Client logged in as an User with German Chars, for example Müller, and have a computername like this, stops the Page modify Logging of the Moin-"server".

This problem is not MMDE specific. As umlauts shouldn't be in DNS, it is not even a bug. But we can handle it easily (and avoid further problems) by falling back to host ip in such a case.

Steps to reproduce

  1. Edit the wikiserverconfig.py for using as an server like this:
    from __main__ import DefaultConfig
    class Config(DefaultConfig):
      port=8080
      interface=""
  2. Start the moin.exe on a computer ("server") with Unicodesupport (Windows 2000, Server 2003, XP)
  3. rename your own computer ("client") e.g. as "Thöne", use a loginaccount "Thöne"
  4. Connect to the server via browser http://10.11.12.13:8080

  5. (you might install the german Help files, but will be no differnce)
  6. Edit a Page, even the Frontpage. After Saving, MoinMoin seems to log the Changes with your Username (or Computername, don't know)

  7. The server reports the bug "UnicodeDecodeError" to your browser.

The error doesn't appear if using the MMDE only in Desktop mode.

Example

Details

This is a snip from the detailed Error, you find the Example with "thöne" as 'TH\xd6NE' after the Line "'ascii' codec can't decode byte 0xd6 in position 2: ordinal not in range(128)"

      C:\Programme\MoinMoinDesktopEngine\MoinMoin\PageEditor.pyo in acquire (self=<MoinMoin.PageEditor.PageLock instance>)
      C:\Programme\MoinMoinDesktopEngine\MoinMoin\PageEditor.pyo in _writeLockFile (self=<MoinMoin.PageEditor.PageLock instance>)
      C:\Programme\MoinMoinDesktopEngine\MoinMoin\logfile\editlog.pyo in add (self=<MoinMoin.logfile.editlog.EditLog instance>, request=<MoinMoin.request.RequestStandAlone object>, mtime=1142845811000000L, rev=0, action='LOCK', pagename=u'Was soll ich im Wiki speichern', host='10.0.54.3', extra=u'', comment=u'')

UnicodeDecodeError

'ascii' codec can't decode byte 0xd6 in position 2: ordinal not in range(128)

    * args = ('ascii', 'TH\xd6NE', 2, 3, 'ordinal not in range(128)')
    * encoding = 'ascii'
    * end = 3
    * object = 'TH\xd6NE'
    * reason = 'ordinal not in range(128)'
    * start = 2

System Details

    * Date: Mon, 20 Mar 2006 09:10:11 +0000
    * Platform: win32 (nt)
    * Python: Python 2.4.2 (C:\Programme\MoinMoinDesktopEngine\moin.exe)
    * MoinMoin: Release 1.5.2rc1 (patch-433; DesktopEdition Release 1.5.2-1)

/!\ Next time please attach html of the error page.

Workaround

Try this patch:

--- orig/MoinMoin/logfile/editlog.py
+++ mod/MoinMoin/logfile/editlog.py
@@ -150,7 +150,8 @@
             
             try:
                 hostname = socket.gethostbyaddr(host)[0]
-            except socket.error:
+                hostname = unicode(hostname, config.charset)
+            except (socket.error, UnicodeError), err:
                 hostname = host
             
             remap_chars = {u'\t': u' ', u'\r': u' ', u'\n': u' ',}

Discussion

Therefore umlauts should be avoided. I doubt host names with umlauts are allowed in DNS.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/UnicodeDecodeErrorGermanChars (last edited 2007-10-29 19:15:54 by localhost)