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

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 9: ordinal not in range(128) #6000

Open
deiferni opened this issue Oct 21, 2019 · 0 comments

Comments

@deiferni
Copy link
Contributor

deiferni commented Oct 21, 2019

In

'{}{}'.format(self.GROUP_PREFIX, obj.id()),
we use Group.id as term token. The id can contain non-ascii characters, so we should handle this when creating tokens.

Steps to reproduce:

  • have groups with non-ascii characters in DN, e.g. with an umlaut, make sure they are in ogds
  • go to Dossier -> Schützen
  • Select one of the fields, e.g. Lesend
  • when you search for the group with an umlaut the following error will be created

https://sentry.4teamwork.ch/sentry/onegov-gever/issues/4503/

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 9: ordinal not in range(128)
(2 additional frame(s) were not displayed)
...
  File "ZPublisher/Publish.py", line 48, in call_object
    result=apply(object,args) # Type s<cr> to step into published object.
  File "apps/eggs/ftw.keywordwidget-1.5.2-py2.7.egg/ftw/keywordwidget/search.py", line 26, in __call__
    batch = Batch.fromPagenumber(items=source.search(query),
  File "apps/eggs/opengever.core-2019.3.4-py2.7.egg/opengever/ogds/base/sources.py", line 124, in search
    self.terms.extend(source.search(query_string))
  File "apps/eggs/opengever.core-2019.3.4-py2.7.egg/opengever/ogds/base/sources.py", line 777, in search
    self.terms.append(self.getTerm(result.id()))
  File "apps/eggs/opengever.core-2019.3.4-py2.7.egg/opengever/ogds/base/sources.py", line 829, in getTerm
    '{}{}'.format(self.GROUP_PREFIX, obj.id()),

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 9: ordinal not in range(128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant