Red Hat Bugzilla – Bug 454076
can't edit user win non-ascii letters in name
Last modified: 2015-01-04 18:33:13 EST
i use 1.1.1 version
i added user with russian letters in name
now if i try to edit that user in web interface i have http 500 error and trace
Created attachment 311039 [details]
Jason, does this seem right?
I think we need to add kid.encoding="utf-8" to /usr/share/ipa/ipagui/config/app.cfg
The kid templates themselves already list utf-8 as the charset but I think the
above is needed for the controllers.
If you don't mind, I could use a bit more information:
1) Did you add the user through the web UI? And was this user added using 1.1.1?
2) What browser and version are you using?
3) What is the user name you are trying to use?
I should have this figured out shortly.
1. yes via 1.1.1 web ui
2. firefox 3 on linux (utf8 locale)
3. i tried to use "Павел Волковицкий"
This only affects the forms that we manually load using
widgets.meta.load_kid_template(). The code path manages to elude every single
place in the TurboGears kid support where the encoding would be set so it uses
the python default encoding (sys.getdefaultencoding()) which is 'ascii'.
i can make it work if i change 'ascii' to 'utf-8' in
/usr/lib/python2.5/site.py:def setencoding(): encoding = 'ascii'
but that's not proper fix
Right. I'm working on a patch that will load the forms templates with the proper
encoding (and it should honor kid.encoding in app.cfg)
Created attachment 312362 [details]
trace of adding a group with non-ascii characters
I an attempt to be thorough I tested adding a group with Павел in the
description and it failed in ldapobject.py. So a different but related problem.
Ok, the problem above wasn't that the description contained non-ascii values but
that the name of the group did.
There appears to be an issue handling items that are part of the DN that are not
Created attachment 312388 [details]
patch to fix template encoding
We used to manually load the template files for the edit pages using
turbogears.meta.load_kid_template(). Unfortunately this went through the one
code path where encoding was completely ignored. It ended up defaulting to
sys.getdefaultencoding() which is 'ascii'. So even though most of the templates
are loaded as 'utf-8' the few that really mattered weren't.
The fix is to call kid.load_template() ourselves and set the encoding of the
class we just loaded to either the setting in the app.cfg file or to the normal
default value of 'utf-8'.
[root@jennyv3 sysrestore]# ipa-adduser tester2
First name: Павел
Last name: Волковицкий
tester2 successfully added
[root@jennyv3 sysrestore]# ipa-finduser tester2
First Name: 0J/QsNCy0LXQuw==
Last Name: 0JLQvtC70LrQvtCy0LjRhtC60LjQuQ==
Home Directory: /home/tester2
Login Shell: /bin/bash
[root@jennyv3 sysrestore]# ipa-addgroup mygroup
mygroup successfully added