2009/02/04

UnicodeEncodeError in Plone

記錄一個 Plone 除錯訊息,發生在會員帳號管理介面。

ERROR Zope.SiteErrorLog http://mysite.com:8080/MySite/prefs_users_overview
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
...
Module zope.tales.tales, line 696, in evaluate
- URL: file:/home/marr/Plone317/zinstance/parts/ \
plone/CMFPlone/skins/plone_templates/batch_macros.pt
- Line 43, Column 8
- Expression:
- Names:
...
'request': ,
'root': ,
'template': ,
'traverse_subpath': [],
'user': }
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
- __traceback_info__: '%s?%s' % (url , mq( request.form, {batch.b_start_str:n.first} ))
Module PythonExpr, line 1, in
Module ZTUtils.Zope, line 181, in make_query

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: \
ordinal not in range(128)

第一次遇到它,是在仿照 http://tomster.org/geek/plonezope/importPASfromCSV.py/view 批次建立會員帳號後發生,後來讀到 http://dev.plone.org/collective/changeset/67165 似乎開啟曙光,在 CMFPlone/patches 裡 unicodehacks.py 和 unicodeFallbackPatch.py 也有線索,希望能即早解決這問題。