From e4ad2e1a2152959b132e15540efb41394704267d Mon Sep 17 00:00:00 2001 From: Sharat Sharma Date: Mon, 17 Apr 2017 16:19:02 +0530 Subject: [PATCH] Fix doc generation for python 3 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: I399b769c3d636e40094837764da6a914132a779c --- doc/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index ab38727..184bd1b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -131,8 +131,8 @@ html_theme = 'nature' 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".')