From 6bc48aeed6276b762f6e6f2faa4eda04eea12520 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Fri, 6 May 2016 14:50:32 +0300 Subject: [PATCH] Use to_utf8() instead of safe_encode() in convert_str() safe_encode() convert string using locale [1]. To avoid possible confuses we should use to_utf8() method instead. [1] https://wiki.openstack.org/wiki/Python3#safe_encode Change-Id: I4b8d81bcec389f224084e5270e884e38836d1136 --- cinder/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/utils.py b/cinder/utils.py index 54dda9847..504be9707 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -831,7 +831,7 @@ def convert_str(text): * convert to Unicode on Python 3: decode bytes from UTF-8 """ if six.PY2: - return encodeutils.safe_encode(text) + return encodeutils.to_utf8(text) else: if isinstance(text, bytes): return text.decode('utf-8')