diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-09-20 14:20:03 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-09-20 14:20:03 +0100 |
commit | c3f76fbca6079c61c5452a77d5e517961aff1143 (patch) | |
tree | 5332e26d1ed553affab322bb0fbe757cd0513c6d | |
parent | 7adb961995a3744f51396502b33ad04a56a317c3 (diff) | |
parent | eb8033f658e8b6f23ba9f4ef4a1b55894f7ea486 (diff) |
Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging
Python Pull request
This fixes the check-python-tox job.
CI including optional jobs is all green:
https://gitlab.com/jsnow/qemu/-/pipelines/372151147
# gpg: Signature made Thu 16 Sep 2021 23:05:35 BST
# gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]
# Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB
# Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E
* remotes/jsnow-gitlab/tags/python-pull-request:
python: pylint 2.11 support
python: Update for pylint 2.10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | python/qemu/machine/machine.py | 7 | ||||
-rw-r--r-- | python/setup.cfg | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index a7081b1845..34131884a5 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -19,6 +19,7 @@ which provides facilities for managing the lifetime of a QEMU VM. import errno from itertools import chain +import locale import logging import os import shutil @@ -290,8 +291,12 @@ class QEMUMachine: return self._subp.pid def _load_io_log(self) -> None: + # Assume that the output encoding of QEMU's terminal output is + # defined by our locale. If indeterminate, allow open() to fall + # back to the platform default. + _, encoding = locale.getlocale() if self._qemu_log_path is not None: - with open(self._qemu_log_path, "r") as iolog: + with open(self._qemu_log_path, "r", encoding=encoding) as iolog: self._iolog = iolog.read() @property diff --git a/python/setup.cfg b/python/setup.cfg index 83909c1c97..fdca265fec 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -87,7 +87,7 @@ ignore_missing_imports = True # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable= +disable=consider-using-f-string, [pylint.basic] # Good variable names which should always be accepted, separated by a comma. @@ -104,6 +104,7 @@ good-names=i, [pylint.similarities] # Ignore imports when computing similarities. ignore-imports=yes +ignore-signatures=yes # Minimum lines number of a similarity. # TODO: Remove after we opt in to Pylint 2.8.3. See commit msg. |