Skip to content

Commit c70fda0

Browse files
committed
doc: fix Sphinx conf.py for Python3
Fix Sphinx configuration file (conf.py) to make it compatible with Python3. Popen opens channel in binary mode by default on Python3. Need to specify text mode, with universal_newlines option which is also available on Python2.
1 parent ce3e20e commit c70fda0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def get_version_release_from_git():
5959
Returns project version and release as string from 'git' repository data.
6060
"""
6161
DEVNULL = open(os.devnull, 'w')
62-
pipe = Popen('git describe --tags --abbrev=0', stdout=PIPE, stderr=DEVNULL, shell=True)
62+
pipe = Popen('git describe --tags --abbrev=0', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
6363
git_current_tag = pipe.stdout.read()
64-
pipe = Popen('git describe --tags', stdout=PIPE, stderr=DEVNULL, shell=True)
64+
pipe = Popen('git describe --tags', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
6565
git_current_desc = pipe.stdout.read()
66-
pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True)
66+
pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
6767
git_current_branch = pipe.stdout.read()
6868

6969
if git_current_desc:

0 commit comments

Comments
 (0)