I'm using Python 2.4, but it happens with python 2.5 also. pydns is 2.3.3, formencode is version 1.2.2.
Reproducing test case:
>>> import formencode.validators
>>> e = formencode.validators.Email(resolve_domain=True)
>>> e.to_python(u'foo@example.com')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ecardg5/python/lib/python2.5/site-packages/FormEncode-1.2.1-py2.5.egg/formencode/api.py", line 416, in to_python
vp(value, state)
File "/home/ecardg5/python/lib/python2.5/site-packages/FormEncode-1.2.1-py2.5.egg/formencode/validators.py", line 1364, in validate_python
a=DNS.DnsRequest(domain, qtype='mx').req().answers
File "build/bdist.linux-i686/egg/DNS/Base.py", line 202, in req
File "build/bdist.linux-i686/egg/DNS/Lib.py", line 461, in addQuestion
File "build/bdist.linux-i686/egg/DNS/Lib.py", line 128, in addname
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 1: ordinal not in range(128)
I note that 2126902 was already filed, but closed as wfm.
Is there any reason that this patch was not applied? http://pythonpaste.org/archives/message/20081015.191555.f6252ba5.en.html
The patch in http://pythonpaste.org/archives/message/20081015.191555.f6252ba5.en.html
should be reviewed, maybe also add the new allow_idna parameter from the URL validator,
see https://bitbucket.org/formencode/official-formencode/changeset/c1c841f7471b