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 , 7 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 7 years ago
Component: | Internationalization → Generic views |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
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.
Regression in e690eb405f09a9e58b9d95ae98991352602635d6