Description

I'm using French TextCha to protect my wiki. The TextCha are in correctly encoded unicode.

Since moving to 1.9.4, I'm unable to edit pages. When trying to edit a page, I get the following backtrace.

Steps to reproduce

  1. Add a TextCha with accents in the text of the question.

  2. Try to edit a page.

Example

ERROR 2012-02-29 17:50:31,427 MoinMoin.wsgiapp:293 An exception has occurred [http://XXX/action/edit/PageD%27Accueil?action=edit&editor=text].
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/wsgiapp.py", line 282, in __call__
    response = run(context)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/wsgiapp.py", line 88, in run
    response = dispatch(request, context, action_name)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/wsgiapp.py", line 136, in dispatch
    response = handle_action(context, pagename, action_name)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/wsgiapp.py", line 195, in handle_action
    handler(context.page.page_name, context)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/action/edit.py", line 76, in execute
    pg.sendEditor()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/PageEditor.py", line 418, in sendEditor
    request.write(TextCha(request).render())
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/security/textcha.py", line 198, in render
    question_form, given_answer_form = self._make_form_values(question, given_answer)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/security/textcha.py", line 161, in _make_form_values
    self._compute_signature(question, timestamp)
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/security/textcha.py", line 86, in _compute_signature
    return hmac_new(self.secret, "%s%d" % (question, timestamp)).hexdigest()
  File "/usr/local/lib/python2.6/dist-packages/MoinMoin/support/python_compatibility.py", line 52, in hmac_new
    return hmac.new(key, msg, digestmod)
  File "/usr/lib/python2.6/hmac.py", line 133, in new
    return HMAC(key, msg, digestmod)
  File "/usr/lib/python2.6/hmac.py", line 75, in __init__
    self.update(msg)
  File "/usr/lib/python2.6/hmac.py", line 83, in update
    self.inner.update(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 22: ordinal not in range(128)

Component selection

Details

MoinMoin Version

1.9.4

OS and Version

Linux Debian Stable

Python Version

2.6.6

Server Setup

Lighttpd + Fastcgi

Server Details

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

French

Workaround

Remove all accents from TextCha :(

Yeah, or apply the patch (see link below).

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.9.4BreaksTextChaWithAccents (last edited 2012-02-29 23:21:50 by ThomasWaldmann)