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