Unable to attach screenshot to a issue using Jira-Python library on Windows 7 machine. I am using the 'rb' option for opening the ".PNG" file but still getting UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 208: character maps to <undefined>
error.
Also with just 'r' open file option the file gets uploaded but the size is 0.0 kb.
Here is the code snippet:
from client import JIRA
jira_options={'server': JIRA_URL}
jira=JIRA(options=jira_options,basic_auth=(usrname,passwd))
issue_obj = jira.issue([new_issue_id])
fileimgpath = "C:/installers/abc.PNG"
imgfile = open(fileimgpath,"rb")
jira.add_attachment(issue_obj,imgfile,"abc.PNG")
Thanks for you help.