提交 80fba68e 编写于 作者: C Cleber Rosa

Avocado: add a default encoding setting

And use it when running tests.

Note: this is a partial implementation, to satisfy the following use
case:

   $ echo "#!/bin/sh" > a.sh
   $ echo "echo ěčřž" >> a.sh
   $ chmod +x a.sh
   $ avocado run a.sh
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 ed4741a3
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright: Red Hat Inc. 2018
# Author: Cleber Rosa <crosa@redhat.com>
"""
The Avocado core defaults
"""
#: The encoding used by default on all data input
ENCODING = 'utf-8'
......@@ -32,6 +32,7 @@ from difflib import unified_diff
from six import string_types, iteritems
from . import data_dir
from . import defaults
from . import exceptions
from . import output
from . import parameters
......@@ -1133,7 +1134,7 @@ class SimpleTest(Test):
# process.run uses shlex.split(), the self.path needs to be escaped
result = process.run(self._command, verbose=True,
env=test_params)
env=test_params, encoding=defaults.ENCODING)
self._log_detailed_cmd_info(result)
except process.CmdError as details:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册