I got this error for a message that contained an apostrophy in the body (description):
File "/usr/lib64/python2.6/urllib.py", line 1261, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 42: ordinal not in range(128)
A workaround is to first convert the description to Unicode:
data = {
'apikey': self.apikey,
'application': application,
'event': event,
'description': description.encode('utf-8'),
'priority': priority
}
I got this error for a message that contained an apostrophy in the body (description):
File "/usr/lib64/python2.6/urllib.py", line 1261, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 42: ordinal not in range(128)
A workaround is to first convert the description to Unicode:
data = {
'apikey': self.apikey,
'application': application,
'event': event,
'description': description.encode('utf-8'),
'priority': priority
}