From e856b563dd0af5447d51a7c8c4fae5ea697befc2 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 31 Aug 2021 10:49:36 +0200 Subject: [PATCH] [pylint] Pylint 2.10 - unspecified-encoding Pylint 2.10 added new default checks [1]: unspecified-encoding: Emitted when open() is called without specifying an encoding [2] [1] https://pylint.pycqa.org/en/latest/whatsnew/2.10.html [2] https://github.com/PyCQA/pylint/issues/3826 Signed-off-by: Markus Heiser --- searx/version.py | 4 ++-- searx_extra/update/update_external_bangs.py | 2 +- searx_extra/update/update_osm_keys_tags.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/searx/version.py b/searx/version.py index 34c37bd22..daada6020 100644 --- a/searx/version.py +++ b/searx/version.py @@ -126,8 +126,8 @@ GIT_URL = "{GIT_URL}" GIT_BRANCH = "{GIT_BRANCH}" """ with open( - os.path.join(os.path.dirname(__file__), "version_frozen.py"), "w" - ) as f: + os.path.join(os.path.dirname(__file__), "version_frozen.py"), + "w", encoding="utf8") as f: f.write(python_code) print(f"{f.name} created") else: diff --git a/searx_extra/update/update_external_bangs.py b/searx_extra/update/update_external_bangs.py index c366fe76b..e6331d47c 100755 --- a/searx_extra/update/update_external_bangs.py +++ b/searx_extra/update/update_external_bangs.py @@ -154,5 +154,5 @@ if __name__ == '__main__': 'version': bangs_version, 'trie': parse_ddg_bangs(fetch_ddg_bangs(bangs_url)) } - with open(get_bangs_filename(), 'w') as fp: + with open(get_bangs_filename(), 'w', encoding="utf8") as fp: json.dump(output, fp, ensure_ascii=False, indent=4) diff --git a/searx_extra/update/update_osm_keys_tags.py b/searx_extra/update/update_osm_keys_tags.py index f803d0c33..a71f2d9a1 100755 --- a/searx_extra/update/update_osm_keys_tags.py +++ b/searx_extra/update/update_osm_keys_tags.py @@ -205,5 +205,5 @@ if __name__ == '__main__': 'keys': optimize_keys(get_keys()), 'tags': optimize_tags(get_tags()), } - with open(get_osm_tags_filename(), 'w') as f: + with open(get_osm_tags_filename(), 'w', encoding="utf8") as f: json.dump(result, f, indent=4, ensure_ascii=False)