Skip to content

Commit

Permalink
Also encode stderr, for better display of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
david-jointech authored Aug 4, 2021
1 parent 9e90816 commit 4e928d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pypandoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ def _convert_input(source, format, input_type, to, extra_args=(), outputfile=Non
except UnicodeDecodeError:
# this shouldn't happen: pandoc more or less garantees that the output is utf-8!
raise RuntimeError('Pandoc output was not utf-8.')

try:
stderr = stderr.decode('utf-8')
except UnicodeDecodeError:
# this shouldn't happen: pandoc more or less garantees that the output is utf-8!
raise RuntimeError('Pandoc output was not utf-8.')

# check that pandoc returned successfully
if p.returncode != 0:
Expand Down

0 comments on commit 4e928d9

Please sign in to comment.