Non-ASCII in web.form.AttributeList

19 views
Skip to first unread message

W. Martin Borgert

unread,
May 2, 2013, 10:05:22 AM5/2/13
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!

Reply all
Reply to author
Forward
0 new messages