Keystone v3 project list failed ascii encoding

Bug #1628528 reported by alessandro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Invalid
Undecided
Unassigned

Bug Description

Currently I'm not able to get the list projects. One of the project in the list has a unicode character in its description (à in may case) that actually generates the issue below:

from keystoneauth1.identity import v3
from keystoneauth1 import session
from keystoneclient.v3 import client

auth = v3.Password(auth_url="http://<ip>:5000/v3", username="admin",
                    password="<pwd>",domain_name="Default",user_domain_name="Default")

sess = session.Session(auth=auth)
keystone = client.Client(session=sess)
keystone.projects.list()

Which fails with following exception

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 35: ordinal not in range(128)

Same error appears using openstack command line client:

$ openstack project show Jakala
'ascii' codec can't encode character u'\xe0' in position 228: ordinal not in range(128)

Right now sticking to keystone v2.0 which seems to be more resilient
>>> keystone.tenants.list()
<Tenant {u'enabled': True, u'description': u'Tenant x Jakal\xe0 - Non toccare', u'name': u'Jakala', u'id': u'e498fd5ef7784bbdbf7d652c2105994b'}>

Revision history for this message
kamalhussain (hussain-kamal) wrote :

I am not able to reproduce this in the Mitaka devstack environment. Here is the log:

bin$ openstack project show Test
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | à ©testing - Ê |
| enabled | True |
| id | e95b3f95649148b5a4a4447d46c875b2 |
| name | Test |
| properties | |
+-------------+----------------------------------+

Revision history for this message
Steve Martinelli (stevemar) wrote :

What version of openstackclient are you using? This should be fixed in 3.2.0, you can test it out in a virtualenv so as to not corrupt your current install.

Are you just calling "keystone.projects.list()" or printing it somewhere?

Revision history for this message
alessandro (bartalucci) wrote :

Currently I'm working in Liberty environment.
Yes, I'm calling "keystone.projects.list()" just to check whether it works in python shell.

For the openstack client version:
$ openstack --version
openstack 1.7.3

My python-keystoneclient==3.5.0 has been installed as a dependency of python-monascaclient==1.2.0 package.

If it has already fixed in mitaka, could please post the link to the patch?

Thanks

summary: - Keystone v3 project list failed ascii enconding
+ Keystone v3 project list failed ascii encoding
Revision history for this message
Lance Bragstad (lbragstad) wrote :

I'm unable to recreate this on version 2.6.0 of python-openstackclient [0].

[0] http://cdn.pasteraw.com/tka2k7xhnjt6aj511ijke2rletkwafo

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

Marking as invalid based upon #4

Changed in python-keystoneclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.