W. Martin Borgert
unread,May 2, 2013, 10:05:22 AM5/2/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to we...@googlegroups.com
Hi,
the following code works for ASCII:
>>> import web.form
>>> a = web.form.AttributeList(type='text', name='x', value="y")
>>> a
<attrs: 'type="text" name="x" value="y"'>
But not, when non-ASCII is involved:
>>> a = web.form.AttributeList(type='text', name='x', value=u"°")
>>> a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/web/form.py", line 191, in __repr__
return '<attrs: %s>' % repr(str(self))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
position 28: ordinal not in range(128)
Is this supposed to work?
Thanks in advance!