無法截圖附加到使用Windows 7機器上吉拉的Python庫中的問題,截圖給JIRA問題。我正在使用「rb」選項打開「.PNG」文件,但仍出現UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 208: character maps to <undefined>
錯誤。 也只是'r'打開文件選項文件被上傳,但大小爲0.0 kb。 這裏是代碼片段:無法附加使用JIRA Python庫
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")
感謝您幫助。