﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3344	newforms UnicodeEncodeError in EmailField on non-successful validation	bartekr	Adrian Holovaty	"newforms EmailField causes UnicodeEncodeError exception in case when value isn't correct.

Exception Type:  	UnicodeEncodeError
Exception Value: 	'ascii' codec can't encode character u'\u017a' in position 33: ordinal not in range(128)
Exception Location: 	/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/newforms/forms.py in _html_output, line 103

I spent some time for debugging and I found that what probably causes the error is:

{{{
        RegexField.__init__(self, email_re, max_length, min_length, gettext(u'Enter a valid e-mail address.'), required, widget, label, initial)
}}}
newforms/fields.py, line 267 (rev. 4386)

When for debug purposes I changed gettext(u'Enter a valid e-mail address.') to anything else (ex. gettext(u'aaa')), the problem didn't occur and the 'aaa' validation error message was displayed like it should. This is probably a problem with translation file or so, but I'm just a Python/django/gettext newbie and I'm just starting my adventure with all of them, so I'm unable to debug it more."		new	Forms	dev			UnicodeEncodeError EmailField		Unreviewed	0	0	0	0	0	0
