Opened 3 years ago

Closed 3 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 Changed 3 years ago by Simon Charette

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by Tim Graham

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