Project

General

Profile

Bug #33083

crash sur next_url.encode('ascii')

Added by Thomas Noël 3 months ago. Updated about 2 months ago.

Status:
Solution déployée
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
14 May 2019
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

Description

Internal Server Error: /accounts/mellon/login/

UnicodeEncodeError at /accounts/mellon/login/
'ascii' codec can't encode character u'\xff' in position 0: ordinal not in range(128)

Request Method: GET
Request URL: https://departement06.test.entrouvert.org/accounts/mellon/login/?next=%ff
Django Version: 1.11.20
Python Executable: /usr/bin/uwsgi-core
Python Version: 2.7.13
Python Path: ['.', '', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
Server time: mar, 14 Mai 2019 11:59:14 +0200
Installed Applications:
''
Installed Middleware:
''

Traceback:

File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/mellon/views.py" in get
  377.         next_url = check_next_url(self.request, request.GET.get(REDIRECT_FIELD_NAME))

File "/usr/lib/python2.7/dist-packages/mellon/views.py" in check_next_url
  56.         next_url.encode('ascii')

Exception Type: UnicodeEncodeError at /accounts/mellon/login/
Exception Value: 'ascii' codec can't encode character u'\xff' in position 0: ordinal not in range(128)
Request information:
USER: ca829e61a2d94ee89a6c2b19148ccf

0001-misc-catch-all-unicode-exceptions-when-checking-next.patch View (818 Bytes) Frédéric Péters, 02 Jun 2019 09:38 PM

Associated revisions

Revision 6284da2a (diff)
Added by Frédéric Péters about 2 months ago

misc: catch all unicode exceptions when checking next_url (#33083)

History

#1 Updated by Frédéric Péters 3 months ago

J'ai voulu limiter à UnicodeEncodeError mais :

Paradoxically, a UnicodeDecodeError may happen when encoding
https://wiki.python.org/moin/UnicodeDecodeError

Pour tout attraper, donc, UnicodeError.

#2 Updated by Emmanuel Cazenave about 2 months ago

  • Status changed from Solution proposée to Solution validée

#3 Updated by Frédéric Péters about 2 months ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 6284da2ae69e8ea48baae965858f98c5c4f2d501
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sun Jun 2 21:35:02 2019 +0200

    misc: catch all unicode exceptions when checking next_url (#33083)

#4 Updated by Frédéric Péters about 2 months ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF