Assume UTF-8 when decoding hg or git output; closes #148

This commit is contained in:
Florent Xicluna 2014-05-05 21:01:05 +02:00
parent a3ecfbaaf8
commit 1ea9f12b18
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ CHANGES
- New option ``doctests`` to run Pyflakes checks on doctests too
- New option ``jobs`` to launch multiple jobs in parallel
- Fix Git and Mercurial hooks, issues #88 and #133
- Fix Git and Mercurial hooks, issues #88, #133 and #148
- Fix crashes with Python 3.4 by upgrading dependencies
- Fix traceback when running tests with Python 2.6
- Fix the setuptools command ``python setup.py flake8`` to read

View file

@ -125,10 +125,10 @@ def run(command, raw_output=False, decode=True):
# endswith method. That should work but might still fail horribly.
if hasattr(stdout, 'decode'):
if decode:
stdout = stdout.decode()
stdout = stdout.decode('utf-8')
if hasattr(stderr, 'decode'):
if decode:
stderr = stderr.decode()
stderr = stderr.decode('utf-8')
if not raw_output:
stdout = [line.strip() for line in stdout.splitlines()]
stderr = [line.strip() for line in stderr.splitlines()]