ysde/grafana-backup-tool

can't encode charecter u'xb0'

Closed this issue · 3 comments

Getting this error. Let me know if you need more info.

Traceback (most recent call last):
File "/home/manderse/bin/grafana-backup-tool/saveDashboards.py", line 47, in
get_indivisual_dashboard_setting_and_save(dashboards)
File "/home/manderse/bin/grafana-backup-tool/saveDashboards.py", line 38, in get_indivisual_dashboard_setting_and_save
status_code_and_content = get_dashboard(board['uri'])
File "/home/manderse/bin/grafana-backup-tool/dashboardApi.py", line 11, in get_dashboard
r = send_grafana_get(grafana_url + "/api/dashboards/{0}".format(board_uri))
File "/home/manderse/bin/grafana-backup-tool/dashboardApi.py", line 67, in send_grafana_get
log_response(r)
File "/home/manderse/bin/grafana-backup-tool/commons.py", line 9, in log_response
print("body: {0}".format(resp.content.decode('utf8')))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 1206: ordinal not in range(128)

ysde commented

Hi @crzykidd
Sorry there is a python2 and python3 string problem.
The request library returns different result in different python version.
I'll fix this asap.

Thank you

ysde commented

Hi @crzykidd

I've fixed it latest commit.

Can you help verify it?
Thank you

Solved. Thank you for a great tool, and fast turnaround.