Source: python-requests
Version: 2.3.0-1
Severity: normal

Dear Maintainer,

It appears as though there is an error with the __str__ method when trying to
handle the requests.exceptions.SSLError exception.

=================
Python 2.7.8 (default, Oct  7 2014, 17:59:21)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> try:
....     r = requests.get('https://example.com:20900')
.... except requests.exceptions.SSLError as e:
....     m = e.message
....
>>> m
SSLError(SSLError('bad handshake', Error([('SSL routines',
'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),)
>>> print m
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __str__ returned non-string (type Error)
>>> m
SSLError(SSLError('bad handshake', Error([('SSL routines',
'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),)
>>> print e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __str__ returned non-string (type Error)
>>> e
SSLError(SSLError(SSLError('bad handshake', Error([('SSL routines',
'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)),),)
=================

This problem doesn't seem to exist when pip and requests are installed via non-
package means.

=================
Python 2.7.8 (default, Oct  7 2014, 17:59:21)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> try:
....     r = requests.get('https://example.com:20900')
.... except requests.exceptions.SSLError as e:
....     m = e.message
....
>>> m
SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
failed (_ssl.c:581)'),)
>>> print m
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
>>> e
SSLError(SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed (_ssl.c:581)'),),)
>>> print e
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
=================


Please let me know if there is any more information you need.

-Jason



-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to