Skip to content

Commit

Permalink
Decode responses from redis
Browse files Browse the repository at this point in the history
FIxes:

    return_value = f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/address.py", line 322, in validate_address
    plugin = plugin_for_esp(exchanger)
  File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/validate.py", line 129, in plugin_for_esp
    if grammar[0].match(mail_exchanger):
TypeError: cannot use a string pattern on a bytes-like object
  • Loading branch information
danimar-nextroll authored Feb 20, 2020
1 parent 2f0e742 commit e70e156
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flanker/addresslib/drivers/redis_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, host=None, port=None, prefix='mxr:', ttl=604800):
host = host or os.environ.get('REDIS_HOST', 'localhost')
port = port or os.environ.get('REDIS_PORT', 6379)
db = os.environ.get('REDIS_DB', 0)
self.r = redis.StrictRedis(host=host, port=port, db=db)
self.r = redis.StrictRedis(host=host, port=port, db=db, decode_responses=True)

def __getitem__(self, key):
try:
Expand Down

0 comments on commit e70e156

Please sign in to comment.