Projet

Général

Profil

Bug #20113

Erreur lorsqu'on tente de logguer une erreur de récupération de métadonnées

Ajouté par Frédéric Péters il y a plus de 6 ans. Mis à jour il y a environ 5 ans.

Statut:
Rejeté
Priorité:
Normal
Assigné à:
Version cible:
Début:
16 novembre 2017
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  125.                     response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/usr/lib/python2.7/dist-packages/mellon/middleware.py" in process_view
  26.         if not any(utils.get_idps()):
File "/usr/lib/python2.7/dist-packages/mellon/utils.py" in get_idps
  111.             for idp in adapter.get_idps():
File "/usr/lib/python2.7/dist-packages/mellon/adapters.py" in get_idps
  44.                         idp['METADATA_URL'], e, i)
File "/usr/lib/python2.7/logging/__init__.py" in error
  1186.             self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python2.7/logging/__init__.py" in _log
  1279.         self.handle(record)
File "/usr/lib/python2.7/logging/__init__.py" in handle
  1289.             self.callHandlers(record)
File "/usr/lib/python2.7/logging/__init__.py" in callHandlers
  1329.                     hdlr.handle(record)
File "/usr/lib/python2.7/logging/__init__.py" in handle
  757.                 self.emit(record)
File "/usr/lib/python2.7/dist-packages/django/utils/log.py" in emit
  115.                 record.getMessage()
File "/usr/lib/python2.7/logging/__init__.py" in getMessage
  335.             msg = msg % self.args

Exception Type: TypeError at /
Exception Value: __str__ returned non-string (type Error)
...
e    SSLError(SSLError(SSLError('bad handshake', Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),),)

Fichiers

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

C'est quelle version de requests sur quoi comme Debian ? Je ne reproduis pas chez moi.

#2

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

Et quoi comme python aussi.

#4

Mis à jour par Benjamin Dauvergne il y a environ 6 ans

  • Assigné à mis à Benjamin Dauvergne
  • Patch proposed changé de Non à Oui
#5

Mis à jour par Benjamin Dauvergne il y a environ 6 ans

Ça ne sert à rien sur une jessie :

In [1]: try: requests.get('https://self-signed.badssl.com/')
   ...: except Exception as e:
   ...:         pass
   ...: 

In [2]: print str(e)
name 'requests' is not defined

In [3]: import requests

In [4]: try: requests.get('https://self-signed.badssl.com/')
except Exception as e:
        pass
   ...: 

In [5]: print str(e)
("bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)",)

In [6]: print '%s' % e
("bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)",)

In [7]: print u'%s' % e
("bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)",)

In [8]: print requests.__version__
2.11.1

et sur ma sid:

In [4]: try: requests.get('https://self-signed.badssl.com/')
   ...: except Exception as e:
   ...:     pass
   ...: 

In [5]: print e
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

In [6]: print str(e)
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

In [7]: print '%s' % e
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

In [8]: print u'%s' % e
HTTPSConnectionPool(host='self-signed.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

In [9]: requests.__version__
Out[9]: '2.18.4'
</pr>
#6

Mis à jour par Benjamin Dauvergne il y a environ 6 ans

  • Version cible mis à 1.2.34
#7

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

  • Statut changé de Nouveau à Rejeté

Bon vraiment c'est impossible à reproduire de nos jours, c'est vraiment lié à des versions pourris (sous-class d'exception dont __str__() renvoie autre chose qu'une string).

Formats disponibles : Atom PDF