#4663: UnicodeDecodeError with SelectDateWidget
--------------------------------+-------------------------------------------
   Reporter:  [EMAIL PROTECTED]  |                Owner:  adrian         
     Status:  new               |            Component:  django.newforms
    Version:  SVN               |           Resolution:                 
   Keywords:  SelectDateWidget  |                Stage:  Unreviewed     
  Has_patch:  0                 |           Needs_docs:  0              
Needs_tests:  0                 |   Needs_better_patch:  0              
--------------------------------+-------------------------------------------
Changes (by mtredinnick):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> My form:
> 
> class EditProfileForm(forms.Form):
>     birthday = forms.DateField(widget=SelectDateWidget(years=range(1968,
> 1988)), label=_('Birthday'))
> 
> If USE_I18N = True in settings, I receive UnicodeDecodeError:
> 
> Request Method: GET
> Exception Type: UnicodeDecodeError
> Exception Value: 'ascii' codec can't decode byte 0xd0 in position 0:
> ordinal not in range(128)
> Exception Location: /usr/local/lib/python2.4/site-
> packages/django/newforms/widgets.py in render, line 173

New description:

 My form:
 {{{
 #!python
 class EditProfileForm(forms.Form):
     birthday = forms.DateField(widget=SelectDateWidget(years=range(1968,
 1988)), label=_('Birthday'))
 }}}
 
 If {{{USE_I18N = True}}} in settings, I receive !UnicodeDecodeError:
 {{{
 Request Method: GET
 Exception Type: UnicodeDecodeError
 Exception Value: 'ascii' codec can't decode byte 0xd0 in position 0:
 ordinal not in range(128)
 Exception Location: /usr/local/lib/python2.4/site-
 packages/django/newforms/widgets.py in render, line 173
 }}}

Comment:

 (Added wiki formatting to description.)
 
 Without a bit more information, it isn't really possible to debug this. I
 suspect it's probably one of the problems that has been fixed on the
 Unicode branch. Please cut-and-paste the full traceback: find the link on
 the Debug screen that says "cut and paste version" and click it, then
 paste the results into a comment (remember to wrap them in `{{{` and `}}}`
 markers to get the wiki formatting right).
 
 Also, which locale is in effect when this error occurs?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4663#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to