Should use six.text_type instead of six.string_types in secretutils

Bug #1773857 reported by Lingxian Kong on 2018-05-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.utils
Undecided
Lingxian Kong

Bug Description

Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> u = '中文'
>>> isinstance(u, six.string_types)
True
>>> u.encode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
>>> isinstance(u, six.text_type)
False

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

Changed in oslo.utils:
assignee: nobody → Lingxian Kong (kong)
status: New → In Progress

Change abandoned by Lingxian Kong (<email address hidden>) on branch: master
Review: https://review.openstack.org/570826
Reason: The root cause of our problem is because the hash data we received is get by using HMAC.digest() instead of HMAC.hexdigest()

Lingxian Kong (kong) on 2018-05-30
Changed in oslo.utils:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers