Skip to content

Commit ce8e30a

Browse files
committed
Decode output from 'subprocess.check_output'
On Python 3, this returns a bytestring, which must be decoded to print it correctly. Signed-off-by: Stephen Finucane <[email protected]> Closes: #43
1 parent 8d931eb commit ce8e30a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

git_pw/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def git_am(mbox, args):
4949
try:
5050
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
5151
except subprocess.CalledProcessError as exc:
52-
print(exc.output)
52+
print(exc.output.decode('utf-8'))
5353
sys.exit(exc.returncode)
5454
else:
55-
print(output, end='')
55+
print(output.decode('utf-8'), end='')
5656

5757

5858
def _tabulate(output, headers, fmt):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
An issue that resulted in invalid output on Python 3 when a patch or series
5+
was not successfully applied has been resolved.

0 commit comments

Comments
 (0)