{{{
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',)
--
Ticket URL: <https://code.djangoproject.com/ticket/28204>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Bug
* component: Uncategorized => Generic views
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:1>
* Attachment "fix.patch" added.
* has_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:2>
Comment (by Andrew):
Regression in 6bd61194d49219276275542662e2fbe690534555
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:3>
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>
* stage: Unreviewed => Accepted
* easy: 1 => 0
Comment:
After adding a test, you can send a pull request to the stable/1.11.x
branch since master doesn't support Python 2 and is thus unaffected as far
as I understand.
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:5>
* needs_tests: 1 => 0
Comment:
[https://github.com/django/django/pull/8571 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"c341803315c17f79a14acd88aaf1d44a23604c8b" c3418033]:
{{{
#!CommitTicketReference repository=""
revision="c341803315c17f79a14acd88aaf1d44a23604c8b"
[1.11.x] Fixed #28204 -- Fixed MultipleObjectMixin.paginate_queryset()
crash on Python 2 if InvalidPage message contains non-ASCII.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e84034b37a690889a2f77d85f85beebbd165598b" e84034b]:
{{{
#!CommitTicketReference repository=""
revision="e84034b37a690889a2f77d85f85beebbd165598b"
Refs #28204 - Forwardported 1.11.2 release note.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28204#comment:8>