zerver/lib/camo.py: Type ignore statement with hex encode.

This commit is contained in:
Eklavya Sharma 2016-07-04 11:22:12 +05:30 committed by Tim Abbott
parent 6a63870136
commit 610f19c791
2 changed files with 1 additions and 2 deletions

View File

@ -43,7 +43,6 @@ exclude_py3 = """
zerver/lib/actions.py
zerver/lib/bugdown/__init__.py
zerver/lib/bugdown/codehilite.py
zerver/lib/camo.py
zerver/lib/ccache.py
zerver/lib/debug.py
zerver/lib/email_mirror.py

View File

@ -15,5 +15,5 @@ def get_camo_url(url):
encoded_url = url.encode("utf-8")
encoded_camo_key = settings.CAMO_KEY.encode("utf-8")
digest = hmac.new(encoded_camo_key, encoded_url, hashlib.sha1).hexdigest()
hex_encoded_url = codecs.encode(encoded_url, "hex")
hex_encoded_url = codecs.encode(encoded_url, "hex") # type: ignore # https://github.com/python/typeshed/issues/300
return "%s%s/%s" % (settings.CAMO_URI, digest, hex_encoded_url.decode("utf-8"))