Hi erveryone!
In my mako template I generate some url like this:
... href="${request.route_url('recipe', title=recipe.title)}"
where recipe.title is a unicode (cyrillic actially) string. Pyramid
generates a correct url:
http://localhost:6543/recipe/%D0%BE%D0%BB%D0%B8%D0%B2%D1%8C%D0%B5. When
then I click on that link I see an error page - blank screen with message "A
server error occurred. Please contact the administrator." The console
output ends with these lines:
...
File
"/home/yentsun/env/local/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.3-py2.7.egg/pyramid_debugtoolbar/panels/templates/headers.jinja2",
line 13, in top-level template code
<td>{{ value|escape }}</td>
File
"/home/yentsun/env/local/lib/python2.7/site-packages/MarkupSafe-0.15-py2.7.egg/markupsafe/_native.py",
line 21, in escape
return Markup(unicode(s)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 8:
ordinal not in range(128)
localhost - - [22/Jan/2012 12:01:26] "GET
/recipe/%D0%BE%D0%BB%D0%B8%D0%B2%D1%8C%D0%B5 HTTP/1.1" 500 59
It seems like a similar problem described in this unanswered stackoverflow
question<http://stackoverflow.com/questions/8894524/pyramid-cyrillic-letters-in-url-shows-a-server-error-occurred-please-contact>.
So is this a bug or I need something else to do to process unicode URI?
Thanks in advance,
Max.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/pLExWgwYcFEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.