Skip to content

Conversation

@katkasian
Copy link

@katkasian katkasian commented May 3, 2021

PagerDutyAlerter class appears to lack handling of non-Latin languages in alert subject / text. Specifically, with Japanese characters HTTP requests fail with the below error:

"UnicodeEncodeError: codec can't encode characters in position 106-125: Body (<redacted>) is not valid Latin-1. Use body.encode(\u0027utf-8\u0027) if you want to send it encoded in UTF-8." ] }'

Tested that specifying encoding as utf-8 on line 1419 of alerts.py resolves the issue.

data=json.dumps(payload, cls=DateTimeEncoder, ensure_ascii=False).encode("utf-8")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant