Skip to content

Commit

Permalink
doc: fix Sphinx conf.py for Python3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xdelaruelle committed Jun 7, 2023
1 parent ce3e20e commit c70fda0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def get_version_release_from_git():
Returns project version and release as string from 'git' repository data.
"""
DEVNULL = open(os.devnull, 'w')
pipe = Popen('git describe --tags --abbrev=0', stdout=PIPE, stderr=DEVNULL, shell=True)
pipe = Popen('git describe --tags --abbrev=0', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
git_current_tag = pipe.stdout.read()
pipe = Popen('git describe --tags', stdout=PIPE, stderr=DEVNULL, shell=True)
pipe = Popen('git describe --tags', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
git_current_desc = pipe.stdout.read()
pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True)
pipe = Popen('git rev-parse --abbrev-ref HEAD', stdout=PIPE, stderr=DEVNULL, shell=True, universal_newlines=True)
git_current_branch = pipe.stdout.read()

if git_current_desc:
Expand Down

0 comments on commit c70fda0

Please sign in to comment.