Address deprecation warnings to be compatible with Django 2.0

This commit is contained in:
Garret Wassermann
2017-12-28 07:23:51 -05:00
parent f91762d4cd
commit 5112f0dfd0
10 changed files with 55 additions and 34 deletions

View File

@ -374,7 +374,10 @@ def ticket_from_message(message, queue, logger):
non_b64_err = TypeError
try:
logger.debug("Try to base64 decode the attachment payload")
payloadToWrite = base64.decodestring(payload)
if six.PY2:
payloadToWrite = base64.decodestring(payload)
else:
payloadToWrite = base64.decodebytes(payload)
except non_b64_err:
logger.debug("Payload was not base64 encoded, using raw bytes")
payloadToWrite = payload