Skip to content

Commit 6b0cc39

Browse files
committed
Decode subprocess output
When export fails the output should be messaged to the user. This however did not work on Python 3 because the result of p.communicate() is a tuple of bytes and join() expects strings. This lead to the error: TypeError: sequence item 0: expected str instance, bytes found
1 parent ce17a40 commit 6b0cc39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ftplugin/orgmode/plugins/Export.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def _export(cls, format_):
8181
p.wait()
8282

8383
if p.returncode != 0 or settings.get(u'org_export_verbose') == 1:
84-
echom('\n'.join(p.communicate()))
84+
echom('\n'.join(map(
85+
lambda x: x.decode('utf-8'),
86+
p.communicate())))
8587
return p.returncode
8688

8789
@classmethod

0 commit comments

Comments
 (0)