Check for ascii with an explicit ascii encode. BOM-728

This commit is contained in:
Ned Batchelder
2019-09-18 14:49:03 -04:00
parent 1c6ed4026e
commit 456ab68986

View File

@@ -36,7 +36,7 @@ def get_shared_secret_key(provider_id):
if isinstance(secret, six.text_type):
try:
secret = str(secret)
secret.encode('ascii') # pylint: disable=pointless-statement
except UnicodeEncodeError:
secret = None
log.error(u'Shared secret key for credit provider "%s" contains non-ASCII unicode.', provider_id)