trivial: Resolve Python 3 issues
Resolve the following exception: AttributeError: 'str' object has no attribute 'decode' This wasn't caught in the gate because that still uses Python 2.7. This is not the case in other environments (Fedora 27). Change-Id: I6b462f19432c4cf9948cddcc095d9d5a85feeb4b
This commit is contained in:
@@ -3,3 +3,4 @@
|
|||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
|
hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
|
||||||
|
oslo.utils>=3.33.0 # Apache-2.0
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import glob
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
import docutils.core
|
import docutils.core
|
||||||
|
from oslo_utils import encodeutils
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +103,7 @@ class TestTitles(testtools.TestCase):
|
|||||||
(len(matches), tpl))
|
(len(matches), tpl))
|
||||||
|
|
||||||
def _check_no_zwsp(self, tpl, raw):
|
def _check_no_zwsp(self, tpl, raw):
|
||||||
matches = raw.decode('utf-8').find(u"\u200B")
|
matches = encodeutils.safe_decode(raw).find(u"\u200B")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
matches, -1,
|
matches, -1,
|
||||||
"Found zero width space characters in file %s" %
|
"Found zero width space characters in file %s" %
|
||||||
|
|||||||
Reference in New Issue
Block a user