[Moin-user] German Umlaut Problem on moin import (UnicodeDecodeError: 'ascii' codec can't decode byte)

Lars Bräuer lb at mpexnet.de
Fri Nov 7 09:05:12 EST 2014


Hello,

we heavily use the import feature of version 1.9.4. Whenever I try to import a page with a German
Umlaut in it's name, I get the following error message:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)

The command I use works fine with non Umlaut pages (--page).

LANG=de_DE.UTF-8 /usr/bin/moin import wikipage \
--wiki-url=https://w.domain.com --page="Test/Über" --file="/tmp/testseite" \
--config-dir=wiki/config --author="Script" \
--comment="Import" 2>&1

I tried to work around this by setting several command line encodings, but in the end there is
always this UnicodeDecodeError.

Is there any other workaround available, besides importing the page with non umlaut characters (i.e.
ue, oe, ae), renaming the page afterwards in the filesystem?

This is the traceback.

Traceback (most recent call last):
  File "/usr/bin/moin", line 6, in <module>
    run()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/script/moin.py", line 15, in run
    MoinScript().run(showtime=0)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/script/__init__.py", line 261, in mainloop
    plugin_class(args[2:], self.options).run() # all starts again there
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/script/import/wikipage.py", line 74, in mainloop
    do_revision_backup=int(self.options.revision_backup))
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/PageEditor.py", line 92, in __init__
    Page.__init__(self, request, page_name, **keywords)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/Page.py", line 179, in __init__
    self.reset()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/Page.py", line 187, in reset
    qpagename = wikiutil.quoteWikinameFS(page_name)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/wikiutil.py", line 238, in quoteWikinameFS
    filename = wikiname.encode(charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)


Best regards

Lars Bräuer
-- 
MPeX.net GmbH / Werner-Voß-Damm 62 / D-12101 Berlin / Germany
MPeXnetworks / www.mpexnetworks.de
Tel: ++49-30-78097 180 / Fax: ++49-30-78097 181

Sitz, Registergericht: Berlin, Amtsgericht Charlottenburg, HRB 76688
Geschäftsführer: Lars Bräuer, Gregor Rex-Lawatscheck




More information about the Moin-user mailing list