Differences between revisions 3 and 4
Revision 3 as of 2006-10-05 16:47:08
Size: 2677
Comment:
Revision 4 as of 2006-10-05 17:34:59
Size: 2099
Comment: please try this patch
Deletions are marked like this. Additions are marked like this.
Line 46: Line 46:
## How to deal with the bug until it is fixed
Don't know how to work around it, but it's easy to fix :-) In user.py place the following line first in User.__init__ (line 214 works for me)
{{{
auth_username = auth_username.decode('utf-8')}}}

The data that comes from Apache is utf-8 encoded, while MoinMoin expects User.name to be Unicode (there's a self.name = auth_username in the third block of __init__).

 /!\ That's the correct fix, but at an incorrect place. :) That auth_username param is expected to be unicode, so you can't decode it in general. I'll try a fix outside of User object. -- ThomasWaldmann [[DateTime(2006-10-05T15:49:17Z)]]
Line 63: Line 55:
 * Status: quite some places need similar fixes, checking ...  * Status: fixed in 1.5 by: http://hg.thinkmo.de/moin/1.5?cs=e170e64644e7 - please try this fix and report back on success or failure.
Line 70: Line 62:
CategoryMoinMoinBug CategoryMoinMoinBugFixed

Description

(My fix is below). When using basic authentication on Apache, where the username contains a non-ascii character, e.g. Bjørn :-), MoinMoin bombs out with a UnicodeDecode error.

Steps to reproduce

  1. set up basic authentication (in the appropriate directory or location directive in httpd.conf)

AuthType Basic
AuthName "mywiki"
AuthUserFile /etc/wikiusers
Require valid-user
  1. create a user with funny chars

/usr/local/apache2/bin/htpasswd -bcs /etc/wikiusers Bjørn password
  1. change wikiconfig.py to use this and autocreate users

from MoinMoin import http
...
    auth = [http]
    user_autocreate = True

Example

Sorry, no example.

Details

attachment:dkwikierr.html

Date: Wed, 04 Oct 2006 11:46:01 +0000 Platform: Linux www.datakortet.no 2.4.20-31.9smp #1 SMP Tue Apr 13 17:40:10 EDT 2004 i686 Python: Python 2.4.3 (/opt/ActivePython-2.4/bin/python) MoinMoin: Release 1.5.5a (release)

MoinMoin Version

OS and Version

Python Version

Server Setup

Server Details

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

Workaround

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/UnicodeErrorWithBasicAuthenticationAndAutoCreate (last edited 2007-10-29 19:12:40 by localhost)