Opened 7 years ago

Closed 7 years ago

#28251 closed Bug (duplicate)

MultipleObjectMixin,paginate_queryset() crashes with UnicodeDecodeError if InvalidPage message contains non-ASCII

Reported by: Paolo Dente Owned by: nobody
Component: Generic views Version: 1.11
Severity: Release blocker Keywords: Paginator i18n
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The new translations files from https://github.com/django/django/commit/afe4edb4eaaad89acefa6b6d0697d6fa67387eea cause an exception with empty pages. For instance, in French you'd get this:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 30: ordinal not in range(128)

This is caused by https://github.com/django/django/blob/master/django/views/generic/list.py#L74 - changing
str(e)
with
unicode(e)
fixes the problem for me.

Change History (2)

comment:1 by Simon Charette, 7 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 7 years ago

Component: InternationalizationGeneric views
Resolution: duplicate
Status: newclosed
Summary: Paginator causes a UnicodeDecodeError on empty pages when language is DE or FR (and possibly others)MultipleObjectMixin,paginate_queryset() crashes with UnicodeDecodeError if InvalidPage message contains non-ASCII

Duplicate of #28204.

Note: See TracTickets for help on using tickets.
Back to Top