1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

jira - fixed base64 decode bug (#2349) (#2350)

* fixed base64 decode bug

* added changelog fragment

(cherry picked from commit 8ddb81a36f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-04-26 05:18:09 +00:00 committed by GitHub
parent 0f0eb53efa
commit 1b05e03384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- jira - fixed error when loading base64-encoded content as attachment (https://github.com/ansible-collections/community.general/pull/2349).

View file

@ -596,7 +596,7 @@ def _prepare_attachment(filename, content=None, mime_type=None):
content = f.read()
else:
try:
content = base64.decode(content)
content = base64.b64decode(content)
except binascii.Error as e:
raise Exception("Unable to base64 decode file content: %s" % e)