mailgun / flanker

Python email address and Mime parsing library
http://www.mailgun.com
Apache License 2.0
1.63k stars 204 forks source link

Decode responses from redis #240

Closed danimar-nextroll closed 4 years ago

danimar-nextroll commented 4 years ago

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
mailgun-ci commented 4 years ago

Can one of the admins verify this patch?

thrawn01 commented 4 years ago

This might not be true for everyone. (We have no such issue in our prod environment)

You could make this optional for example.

decode_resp = os.environ.get('REDIS_DECODE_RESPONSES, '')

to make it optional.

danimar-nextroll commented 4 years ago

@thrawn01 Thanks for the review. Done the changes.