atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.37k stars 662 forks source link

Jira - Encoding error retrieving issues #759

Open graydryan opened 3 years ago

graydryan commented 3 years ago

Having issue retrieving Jira Issue. This seems to be an issue with ASCII and UTF-8 encoding.

Code:

from atlassian import Jira

jira = Jira(
    url='https://instance.atlassian.net',
    username='user@domain.com',
    password='token',
    cloud=True)

JQL = 'project = FL'
data = jira.jql(JQL)

summary = jira.issue(key = "SVC-187", fields = ["issuetype", "status", "summary"])

print(summary)

Error

Traceback (most recent call last): File "test.py", line 10, in <module> data = jira.jql(JQL) File "/home/parallels/.local/lib/python2.7/site-packages/atlassian/jira.py", line 2271, in jql return self.get("rest/api/2/search", params=params) File "/home/parallels/.local/lib/python2.7/site-packages/atlassian/rest_client.py", line 272, in get absolute=absolute, File "/home/parallels/.local/lib/python2.7/site-packages/atlassian/rest_client.py", line 232, in request log.debug("HTTP: Response text -> {}".format(response.text)) UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 193089: ordinal not in range(128)

isaac-philip commented 3 years ago

is python 2.7 a necessity or can we try python3.7 and see if the issue occurs there too ?