From 776241e2fa7066eb451534fe7a34c403c69fca1c Mon Sep 17 00:00:00 2001 From: M V P Nitesh Date: Mon, 17 Apr 2017 18:12:01 +0530 Subject: [PATCH] Fix doc generation for Python3 Fix the Sphinx html_last_updated_fmt for Python3. The html_last_updated_fmt option is interpeted as a byte string in python3, causing Sphinx build to break. This patch makes it utf-8 string. Change-Id: I9acc4200751e63fa29be738cfa00c4637efd8287 --- api-ref/source/conf.py | 3 +-- doc/source/conf.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 34bdfceb89..a0acf4f180 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -163,8 +163,7 @@ pygments_style = 'sphinx' git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", "-n1"] try: - html_last_updated_fmt = subprocess.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] + html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') except Exception: warnings.warn('Cannot get last updated time from git repository. ' 'Not setting "html_last_updated_fmt".') diff --git a/doc/source/conf.py b/doc/source/conf.py index cb0d9e429c..5e33300a24 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -188,8 +188,7 @@ html_theme_options = { git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", "-n1"] try: - html_last_updated_fmt = subprocess.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] + html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') except Exception: warnings.warn('Cannot get last updated time from git repository. ' 'Not setting "html_last_updated_fmt".')