Skip to content

Commit

Permalink
fix: dev: force output encoding to 'utf-8' on windows for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vaab committed Mar 10, 2017
1 parent 07df3d9 commit 412ac96
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os.path
import shutil
import re
import sys

from gitchangelog import gitchangelog

Expand Down Expand Up @@ -99,7 +100,18 @@ def _wrapped(*args, **kwargs):
PYTHONPATH="%s" % BASE_PATH,
tprog=tprog)
else:
tprog_set = set_env(tprog=tprog)
tprog = ('"%(python)s" "%(tprog)s"'
% {'python': sys.executable,
'tprog': tprog})
if WIN32:
## For some reasons, even on 3.6, outputs in tests are in ``cp1252``.
tprog_set = set_env(
PYTHONIOENCODING="utf-8",
tprog=tprog)
else:
tprog_set = set_env(
tprog=tprog)


w = replace_tprog(tprog_set(gitchangelog.wrap))
cmd = replace_tprog(tprog_set(gitchangelog.cmd))
Expand Down

0 comments on commit 412ac96

Please sign in to comment.