Skip to content

Commit

Permalink
Version 3.3.10
Browse files Browse the repository at this point in the history
Fix SSL regression introduced in 3.3.9

The wrapper introduced to handle SSL timeout errors in Python 2.7
incorrectly assumed that instances of SSLError would always have a
string as their first element. The safer approach is to check the
message attribute on the error.
  • Loading branch information
zbristow authored and andymccurdy committed Oct 10, 2019
1 parent a03c12e commit e1bc385
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES
@@ -1,3 +1,6 @@
* 3.3.10
* Fixed a potential error handling bug for the SSLError -> TimeoutError
mapping introduced in 3.3.9. hanks @zbristow. #1224
* 3.3.9
* Mapped Python 2.7 SSLError to TimeoutError where appropriate. Timeouts
should now consistently raise TimeoutErrors on Python 2.7 for both
Expand Down
2 changes: 1 addition & 1 deletion redis/__init__.py
Expand Up @@ -29,7 +29,7 @@ def int_or_str(value):
return value


__version__ = '3.3.9'
__version__ = '3.3.10'
VERSION = tuple(map(int_or_str, __version__.split('.')))

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion redis/_compat.py
Expand Up @@ -98,7 +98,7 @@ def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except _SSLError as e:
if any(x in e.args[0] for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):
if any(x in e.message for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):

This comment has been minimized.

Copy link
@harpener

harpener Oct 11, 2019

@zbristow @andymccurdy That attribute was officially removed and does not exist in some Python2 distributions: https://www.python.org/dev/peps/pep-0352/

# Raise socket.timeout for compatibility with Python 3.
raise socket.timeout(*e.args)
raise
Expand Down

0 comments on commit e1bc385

Please sign in to comment.