From a8b7dd7bffe343f00bcd6409534edcab530a4fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Wed, 28 Jul 2021 20:18:44 +0200 Subject: Add unspecified-encoding checker #3826 (#4753) * Add unspecified-encoding checker #3826 This adds an unspecified-encoding checker that adds a warning whenever open() is called without an explicit encoding argument. This closes #3826 * Update tests to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added, or the message has been disabled. This also includes small linting changes to a small number of tests. Their test-data has been updated to reflect new line numbers. * Update scripts to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. * Update pylint to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- tests/test_import_graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_import_graph.py') diff --git a/tests/test_import_graph.py b/tests/test_import_graph.py index 92ca4a510..07a093759 100644 --- a/tests/test_import_graph.py +++ b/tests/test_import_graph.py @@ -46,7 +46,7 @@ POSSIBLE_DOT_FILENAMES = ["foo.dot", "foo.gv", "tests/regrtest_data/foo.dot"] def test_dependencies_graph(dest): """DOC files are correctly generated, and the graphname is the basename""" imports._dependencies_graph(dest, {"labas": ["hoho", "yep"], "hoho": ["yep"]}) - with open(dest) as stream: + with open(dest, encoding="utf-8") as stream: assert ( stream.read().strip() == """ -- cgit v1.2.1