Skip to content

Conversation

phillipberndt
Copy link
Contributor

In my example, I had "Dänemark" (german for Denmark) as a choice. The problem is the line

setattr(result, str(k), True)

in forms.py. If k is non-ascii unicode, then str will fail. My proposed solution is to always try to interpret k as unicode and then encode to utf-8, if Python 2 is used. This seems to work as intended (No AttributeError is raised) and while this admittetly also does not cover all use cases, it will work for most users.

setattr(object, unicode that can't be encoded to ascii, value) did not
work there. So instead, force encoding as utf8 which hopefully everyone
out there uses.
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