From 51e12f81e410a3459b118e9551e77ff61470d4ef Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 5 Feb 2019 08:48:04 +0100 Subject: Fix a couple of warnings --- pylint/reporters/json.py | 4 ++-- pylint/test/test_func.py | 2 +- pylint/test/test_self.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pylint/reporters/json.py b/pylint/reporters/json.py index 6a5020102..100ed5264 100644 --- a/pylint/reporters/json.py +++ b/pylint/reporters/json.py @@ -9,7 +9,7 @@ """JSON reporter""" from __future__ import absolute_import, print_function -import cgi +import html import json import sys @@ -40,7 +40,7 @@ class JSONReporter(BaseReporter): "path": msg.path, "symbol": msg.symbol, # pylint: disable=deprecated-method; deprecated since 3.2. - "message": cgi.escape(msg.msg or ""), + "message": html.escape(msg.msg or ""), "message-id": msg.msg_id, } ) diff --git a/pylint/test/test_func.py b/pylint/test/test_func.py index 091a6d71d..0d9694545 100644 --- a/pylint/test/test_func.py +++ b/pylint/test/test_func.py @@ -90,7 +90,7 @@ class LintTestUsingModule(object): def _get_expected(self): if self._has_output() and self.output: - with open(self.output, "U") as fobj: + with open(self.output, "r") as fobj: return fobj.read().strip() + "\n" else: return "" diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py index cbc23176b..2c3907e05 100644 --- a/pylint/test/test_self.py +++ b/pylint/test/test_self.py @@ -185,7 +185,7 @@ class TestRunTC(object): master = re.search(r"\[MASTER", output) out = StringIO(output[master.start() :]) parser = configparser.RawConfigParser() - parser.readfp(out) + parser.read_file(out) messages = utils._splitstrip(parser.get("MESSAGES CONTROL", "disable")) assert "suppressed-message" in messages -- cgit v1.2.1