Skip to content
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

Problem handling unicode characters #2915

Closed
cserf opened this issue Sep 19, 2019 · 1 comment · Fixed by #4003
Closed

Problem handling unicode characters #2915

cserf opened this issue Sep 19, 2019 · 1 comment · Fixed by #4003

Comments

@cserf
Copy link
Contributor

cserf commented Sep 19, 2019

Motivation

Traceback :

[Thu Sep 19 08:30:41.397728 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832] Traceback (most recent call last):
[Thu Sep 19 08:30:41.397762 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process
[Thu Sep 19 08:30:41.397766 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     return self.handle()
[Thu Sep 19 08:30:41.397774 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle
[Thu Sep 19 08:30:41.397777 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     return self._delegate(fn, self.fvars, args)
[Thu Sep 19 08:30:41.397780 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/web/application.py", line 462, in _delegate
[Thu Sep 19 08:30:41.397783 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     return handle_class(cls)
[Thu Sep 19 08:30:41.397786 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/web/application.py", line 438, in handle_class
[Thu Sep 19 08:30:41.397789 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     return tocall(*args)
[Thu Sep 19 08:30:41.397791 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/rucio/web/rest/account.py", line 509, in POST
[Thu Sep 19 08:30:41.397794 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     raise generate_http_error(409, 'Duplicate', error.args[0])
[Thu Sep 19 08:30:41.397797 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]   File "/usr/lib/python2.7/site-packages/rucio/common/utils.py", line 309, in generate_http_error
[Thu Sep 19 08:30:41.397800 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]     if len(str(exc_msg)) > 15000:
[Thu Sep 19 08:30:41.397803 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832] UnicodeEncodeError: 'ascii' codec can't encode character u'\\xed' in position 89: ordinal not in range(128)
[Thu Sep 19 08:30:41.397823 2019] [:error] [pid 3042:tid 139805664990976] [client 188.185.80.147:50832]
@bari12 bari12 changed the title Core : Problem handling unicode characters Problem handling unicode characters Oct 9, 2019
@bziemons
Copy link
Member

@bari12 as I said, this should only happen with Python 2 as in Python 3 all strings are unicode capable by default. Should I still fix it?

bziemons added a commit to bziemons/rucio that referenced this issue Sep 16, 2020
Do not convert unicode to str in Python 2 and correctly pass unicode on.
bziemons added a commit to bziemons/rucio that referenced this issue Sep 17, 2020
Do not convert unicode to str in Python 2 and correctly pass unicode on.
@bziemons bziemons linked a pull request Sep 17, 2020 that will close this issue
bziemons added a commit to bziemons/rucio that referenced this issue Sep 18, 2020
Do not convert unicode to str in Python 2 and correctly pass unicode on.
bari12 added a commit that referenced this issue Sep 22, 2020
Core & Internals: Fix unicode for http errors; Fix #2915
bari12 pushed a commit that referenced this issue Sep 22, 2020
Do not convert unicode to str in Python 2 and correctly pass unicode on.
@bari12 bari12 added this to the 1.23.7 milestone Sep 22, 2020
@bari12 bari12 assigned bziemons and unassigned mlassnig Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants