Browse Source

Fix html_last_updated_fmt for Python3

html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Change-Id: I39e3cc70f51f9ebb2973ea5a7e6cb12d3b19d6cb
Closes-Bug:#1693670
tags/5.0.0
Vu Cong Tuan 1 year ago
parent
commit
5f1377bb94
2 changed files with 2 additions and 4 deletions
  1. 1
    2
      api-ref/source/conf.py
  2. 1
    2
      doc/source/conf.py

+ 1
- 2
api-ref/source/conf.py View File

@@ -157,8 +157,7 @@ pygments_style = 'sphinx'
157 157
 git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
158 158
     "-n1"]
159 159
 try:
160
-    html_last_updated_fmt = subprocess.Popen(
161
-        git_cmd, stdout=subprocess.PIPE).communicate()[0].decode()
160
+    html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
162 161
 except Exception:
163 162
     warnings.warn('Cannot get last updated time from git repository. '
164 163
                   'Not setting "html_last_updated_fmt".')

+ 1
- 2
doc/source/conf.py View File

@@ -65,8 +65,7 @@ htmlhelp_basename = '%sdoc' % project
65 65
 git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
66 66
     "-n1"]
67 67
 try:
68
-    html_last_updated_fmt = subprocess.Popen(
69
-        git_cmd, stdout=subprocess.PIPE).communicate()[0]
68
+    html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
70 69
 except Exception:
71 70
     warnings.warn('Cannot get last updated time from git repository. '
72 71
                   'Not setting "html_last_updated_fmt".')

Loading…
Cancel
Save