various md-* api's failed if 4 bytes characters is given

Bug #1570766 reported by Bhagyashri Shewale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Bhagyashri Shewale

Bug Description

variouse md-* api's fails if 4 bytes character (πŸš“) is given by the user.

Steps to Reproduce:

$ glance md-namespace-show πŸš“

Result:

'ascii' codec can't encode character u'\U0001f693' in position 0: ordinal not in range(128).

List of APIs failing:

1. md-namespace-show
2. md-namespace-update
3. md-namespace-delete
4. md-namespace-resource-type-list
5. md-namespace-tags-delete
6. md-namespace-objects-delete
7. md-namespace-properties-delete
8. md-object-create
9. md-object-show
10. md-object-list
11. md-object-delete
12. md-object-property-show
13. md-property-create
14. md-property-list
15. md-property-show
16. md-property-delete
17. md-tag-list
18. md-tag-create
19. md-tag-show
20. md-tag-delete

Changed in python-glanceclient:
assignee: nobody → Bhagyashri Shewale (bhagyashri-shewale)
description: updated
summary: - md-* api's failed if 4 bytes characters is given
+ various-md-* api's failed if 4 bytes characters is given
summary: - various-md-* api's failed if 4 bytes characters is given
+ various md-* api's failed if 4 bytes characters is given
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/312915

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Bhagyashri Shewale (<email address hidden>) on branch: master
Review: https://review.openstack.org/312915

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/320379

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/320379
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=a884becdd4a51f79821833ef97a4e66e6a129d24
Submitter: Jenkins
Branch: master

commit a884becdd4a51f79821833ef97a4e66e6a129d24
Author: bhagyashris <email address hidden>
Date: Tue May 24 17:07:00 2016 +0530

    Fix 'UnicodeEncodeError' for unicode values in url

    Used '%' instead of format() because format() function doesn't
    support the parsing of unicode codec like u'\U0001f693' in Python 2.

    Python3 parse unicode codec with .format() correctly.

    For example:

    openstack@openstack-VirtualBox:~$ python2
    Python 2.7.6 (default, Oct 26 2016, 20:30:19)

    >>> '{0}'.format(u'\U0001f693')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    UnicodeEncodeError: 'ascii' codec can't encode character u'\U0001f693'
    in position 0: ordinal not in range(128)

    >>> '%s' % (u'\U0001f693')
    u'\U0001f693'

    NOTE: format() fuction will parse unicode codec in Python 2 after
    prefixing 'u' like u'{0}.format(u'\U0001f693') but prfixing 'u'
    at every place is not good, so it's better to use the '%' module.

    Change-Id: I2fcca96a1356df08453e08487afb62dfec91ba9d
    Closes-Bug: #1570766

Changed in python-glanceclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-glanceclient 2.8.0

This issue was fixed in the openstack/python-glanceclient 2.8.0 release.

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.