summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/__init__.py4
-rw-r--r--sphinx/ext/imgmath.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index 6a2b88fef..f03a53b1f 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -56,8 +56,8 @@ if __version__.endswith('+'):
__version__ = __version__[:-1] # remove '+' for PEP-440 version spec.
try:
ret = subprocess.run(['git', 'show', '-s', '--pretty=format:%h'],
- stdout=PIPE, stderr=PIPE)
+ stdout=PIPE, stderr=PIPE, encoding='ascii')
if ret.stdout:
- __display_version__ += '/' + ret.stdout.decode('ascii').strip()
+ __display_version__ += '/' + ret.stdout.strip()
except Exception:
pass
diff --git a/sphinx/ext/imgmath.py b/sphinx/ext/imgmath.py
index 4297ad182..911445a54 100644
--- a/sphinx/ext/imgmath.py
+++ b/sphinx/ext/imgmath.py
@@ -86,8 +86,8 @@ DOC_BODY_PREVIEW = r'''
\end{document}
'''
-depth_re = re.compile(br'\[\d+ depth=(-?\d+)\]')
-depthsvg_re = re.compile(br'.*, depth=(.*)pt')
+depth_re = re.compile(r'\[\d+ depth=(-?\d+)\]')
+depthsvg_re = re.compile(r'.*, depth=(.*)pt')
depthsvgcomment_re = re.compile(r'<!-- DEPTH=(-?\d+) -->')
@@ -175,10 +175,10 @@ def compile_math(latex: str, builder: Builder) -> str:
raise MathExtError('latex exited with error', exc.stderr, exc.stdout)
-def convert_dvi_to_image(command: List[str], name: str) -> Tuple[bytes, bytes]:
+def convert_dvi_to_image(command: List[str], name: str) -> Tuple[str, str]:
"""Convert DVI file to specific image format."""
try:
- ret = subprocess.run(command, stdout=PIPE, stderr=PIPE, check=True)
+ ret = subprocess.run(command, stdout=PIPE, stderr=PIPE, check=True, encoding='ascii')
return ret.stdout, ret.stderr
except OSError:
logger.warning(__('%s command %r cannot be run (needed for math '