Fix html_last_updated_fmt for Python3

gitsha  and pwd options are interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Change-Id: I9541793b4e979ce7637ee5a0e61a881826b3f86f
This commit is contained in:
lingyongxu 2017-06-09 17:57:23 +08:00
parent 6fdead9593
commit 66e1dfa745
1 changed files with 2 additions and 5 deletions

View File

@ -82,13 +82,10 @@ release = version_info.release_string()
giturl = (u"https://git.openstack.org/cgit/openstack/barbican/tree/"
"api-guide/source")
git_cmd = ["/usr/bin/git", "rev-parse", "HEAD"]
gitsha = subprocess.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0]
gitsha = subprocess.check_output(git_cmd).decode('utf-8')
# source tree
pwd = subprocess.Popen(
"pwd", stdout=subprocess.PIPE).communicate()[0].strip('\n')
pwd = subprocess.check_output("pwd").decode('utf-8')
# html_context allows us to pass arbitrary values into the html template
html_context = {"pwd": pwd,