* [PATCH] Fix python3 compatibility for sphinx conf.py
@ 2020-03-05 0:36 Rob Herring
0 siblings, 0 replies; only message in thread
From: Rob Herring @ 2020-03-05 0:36 UTC (permalink / raw)
To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA
In python3, subprocess.check_output() returns a bytearray. We need to
encode this into a string type for 'version' and fix this error:
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sphinx/config.py", line 368, in eval_config_file
execfile_(filename, namespace)
File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line 150, in execfile_
exec_(code, _globals)
File "/home/rob/proj/git/devicetree-specification/source/conf.py", line 260, in <module>
if '-' in release:
TypeError: a bytes-like object is required, not 'str'
Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
source/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/conf.py b/source/conf.py
index 3f5cc2c27538..c6cddb9afa3a 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -66,7 +66,7 @@ author = u'devicetree.org'
#
# The short X.Y version.
try:
- version = subprocess.check_output(["git", "describe", "--dirty"]).strip()
+ version = subprocess.check_output(["git", "describe", "--dirty"]).strip().encode()
except:
version = "unknown-rev"
# The full version, including alpha/beta/rc tags.
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-05 0:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05 0:36 [PATCH] Fix python3 compatibility for sphinx conf.py Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).