From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] Fix python3 compatibility for sphinx conf.py
Date: Wed, 4 Mar 2020 18:36:16 -0600 [thread overview]
Message-ID: <20200305003616.3626-1-robh@kernel.org> (raw)
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
reply other threads:[~2020-03-05 0:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200305003616.3626-1-robh@kernel.org \
--to=robh-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.