Bug #33083
crash sur next_url.encode('ascii')
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
14 mai 2019
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
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
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a presque 5 ans
- Fichier 0001-misc-catch-all-unicode-exceptions-when-checking-next.patch 0001-misc-catch-all-unicode-exceptions-when-checking-next.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
J'ai voulu limiter à UnicodeEncodeError mais :
Paradoxically, a UnicodeDecodeError may happen when encoding
— https://wiki.python.org/moin/UnicodeDecodeError
Pour tout attraper, donc, UnicodeError.
Mis à jour par Emmanuel Cazenave il y a presque 5 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Solution validée à 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)
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
misc: catch all unicode exceptions when checking next_url (#33083)