Skip to content

Commit 4e928d9

Browse files
Also encode stderr, for better display of errors
Fixes #226
1 parent 9e90816 commit 4e928d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎pypandoc/__init__.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,12 @@ def _convert_input(source, format, input_type, to, extra_args=(), outputfile=Non
315315
except UnicodeDecodeError:
316316
# this shouldn't happen: pandoc more or less garantees that the output is utf-8!
317317
raise RuntimeError('Pandoc output was not utf-8.')
318+
319+
try:
320+
stderr = stderr.decode('utf-8')
321+
except UnicodeDecodeError:
322+
# this shouldn't happen: pandoc more or less garantees that the output is utf-8!
323+
raise RuntimeError('Pandoc output was not utf-8.')
318324

319325
# check that pandoc returned successfully
320326
if p.returncode != 0:

0 commit comments

Comments
 (0)