Skip to content

Unicode issue #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
item4 opened this issue Dec 29, 2014 · 1 comment
Closed

Unicode issue #27

item4 opened this issue Dec 29, 2014 · 1 comment

Comments

@item4
Copy link
Contributor

item4 commented Dec 29, 2014

Hello. I'm using Korean and I tried notify error messages to our dev room. But it's not work.

It's traceback.

Error processing 'post_process' on 'HipchatMessage': 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/utils/safe.py", line 19, in safe_execute
    result = func(*args, **kwargs)
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry_hipchat/models.py", line 91, in post_process
    }, notify, color=COLORS.get(level, 'purple'))
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry_hipchat/models.py", line 103, in send_payload
    data = urllib.urlencode(values)
  File "/usr/lib/python2.7/urllib.py", line 1332, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)
Error processing 'post_process' on 'HipchatMessage': 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/utils/safe.py", line 19, in safe_execute
    result = func(*args, **kwargs)
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry_hipchat/models.py", line 91, in post_process
    }, notify, color=COLORS.get(level, 'purple'))
  File "/home/trex/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry_hipchat/models.py", line 103, in send_payload
    data = urllib.urlencode(values)
  File "/usr/lib/python2.7/urllib.py", line 1332, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)

I configed like this.

Token: SECRET
Room: ReadyApp
checked Notify
checked Include project name

I think if project names contain non-ascii character, it occur error(I tried only alphabet project name. it was not occur error.) and it will can fix by .encode('utf-8').

@item4
Copy link
Contributor Author

item4 commented Dec 30, 2014

Why I can't fix it? :(

I install it use pip install -e . and add .encode('utf-8') and pdb. but it ignore pdb.

I run it use sentry start

MitchellXen pushed a commit to MitchellXen/sentry-hipchat that referenced this issue Aug 7, 2015
fix encode error for multibyte charsets (close linovia#27)
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

No branches or pull requests

1 participant