Files
python-glanceclient/glanceclient
bhagyashris a884becdd4 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
2017-01-24 12:39:20 +05:30
..
2017-01-20 14:50:42 +05:30
2017-01-19 14:31:01 +00:00
2015-07-21 17:08:27 +03:00