From f3ed268a72bbc0eb5e17abb5b7b6a881cf68d62f Mon Sep 17 00:00:00 2001 From: chuter Date: Mon, 24 Jun 2019 18:15:49 +0800 Subject: [PATCH] bugfix: fix DecodeError when under Windowns env --- lint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lint.py b/lint.py index 272a9d9..45488d6 100644 --- a/lint.py +++ b/lint.py @@ -344,13 +344,14 @@ def lint_external(lines, settings, interpreter, linter): stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, - startupinfo=startupinfo + startupinfo=startupinfo, + universal_newlines=True ) - result = proc.communicate(input=lines.encode('utf-8'))[0] + result = proc.communicate(input=lines)[0] # parse STDOUT for warnings and errors for line in result.splitlines(): - line = line.decode('utf-8').strip() + line = line.strip() warning = line.split(':', 2) if len(warning) == 3: try: