#28204: UnicodeDecodeError in paginate_queryset
-------------------------------+--------------------------------------
Reporter: Andrew | Owner: nobody
Type: Bug | Status: new
Component: Generic views | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by Andrew:
Old description:
> In Django 1.11.1 in function (django.views.generic.list.py):
> paginate_queryset
>
> {{{
> try:
> page = paginator.page(page_number)
> return (paginator, page, page.object_list,
> page.has_other_pages())
> except InvalidPage as e:
> raise Http404(_('Invalid page (%(page_number)s):
> %(message)s') % {
> 'page_number': page_number,
> 'message': str(e)
> }}}
>
> line 'message': **str(e)** contains mistake. Maybe use **force_text**
> instead of **str**
> We have UnicodeDecodeError when non English locale:
>
> EmptyPage(u'\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435
> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442
> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432',)
New description:
In Django 1.11.1 in function (django.views.generic.list.py):
paginate_queryset
{{{
try:
page = paginator.page(page_number)
return (paginator, page, page.object_list,
page.has_other_pages())
except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s):
%(message)s') % {
'page_number': page_number,
'message': str(e)
}}}
line 'message': **str(e)** contains mistake. Maybe use **force_text**
instead of **str**
We have UnicodeDecodeError when non English locale:
EmptyPage(u'\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435
\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442
\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432',)
Regression in 6bd61194d49219276275542662e2fbe690534555
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:4>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.c1256d6d32a3eb77b02bc04a0d399c50%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.