summaryrefslogtreecommitdiff
path: root/tests/helpers.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-11-01 05:12:56 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-11-01 05:12:56 -0500
commit555e0be42a49cadf3f3fdc031871e4a3e3083959 (patch)
tree83c62e759dff50e5f34101af4a2204fd2c66dcd1 /tests/helpers.py
parentffca91900b9675b1f0edd5201955a40a62c6671f (diff)
downloadpython-coveragepy-git-555e0be42a49cadf3f3fdc031871e4a3e3083959.tar.gz
Window encodings?
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index be2484f3..f4bff2b0 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -8,6 +8,7 @@ import subprocess
import sys
from coverage import env
+from coverage.misc import output_encoding
def run_command(cmd):
@@ -23,7 +24,7 @@ def run_command(cmd):
# the subprocess is set incorrectly to ascii. Use an environment variable
# to force the encoding to be the same as ours.
sub_env = dict(os.environ)
- encoding = sys.__stdout__.encoding
+ encoding = output_encoding()
if encoding:
sub_env['PYTHONIOENCODING'] = encoding
@@ -39,7 +40,7 @@ def run_command(cmd):
# Get the output, and canonicalize it to strings with newlines.
if not isinstance(output, str):
- output = output.decode('utf-8')
+ output = output.decode(output_encoding())
output = output.replace('\r', '')
return status, output