From 386a5b669fcafa5ecad82c02eaf142c941a2ac02 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 11 Apr 2018 19:38:14 +0900 Subject: [PATCH] Make babel_extract_angular work with python 3 Also run pep8 env with python3 as pep8/flake8 python 3 is generally more strict. Change-Id: Id4669ca1f929826f07cfe2928092d0e7255fda6f Closes-Bug: #1762992 --- horizon/utils/babel_extract_angular.py | 3 ++- tox.ini | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/horizon/utils/babel_extract_angular.py b/horizon/utils/babel_extract_angular.py index ff517cedca..cdf4bd5814 100644 --- a/horizon/utils/babel_extract_angular.py +++ b/horizon/utils/babel_extract_angular.py @@ -15,6 +15,7 @@ import re +from oslo_utils import encodeutils from six.moves import html_parser @@ -165,7 +166,7 @@ def extract_angular(fileobj, keywords, comment_tags, options): parser = AngularGettextHTMLParser() for line in fileobj: - parser.feed(line) + parser.feed(encodeutils.safe_decode(line)) for string in parser.strings: yield(string) diff --git a/tox.ini b/tox.ini index 59af27020f..28a7e241c4 100644 --- a/tox.ini +++ b/tox.ini @@ -46,6 +46,7 @@ commands = bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs} [testenv:pep8] +basepython = python3 # sphinx (precisely Pygments) needs to be installed to make doc8 work properly deps = {[testenv]deps}