From 5a156a0befe0291c5d513a2483224faa51b2bbd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Apr 2022 08:52:46 +0000 Subject: [PATCH 1/2] Bump typing-extensions from 4.1.1 to 4.2.0 Bumps [typing-extensions](https://github.com/python/typing) from 4.1.1 to 4.2.0. - [Release notes](https://github.com/python/typing/releases) - [Changelog](https://github.com/python/typing/blob/master/typing_extensions/CHANGELOG.md) - [Commits](https://github.com/python/typing/compare/4.1.1...4.2.0) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 253ab139d..cd2334df4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,4 @@ langdetect==1.0.9 setproctitle==1.2.3 redis==4.2.2 markdown-it-py==2.1.0 -typing_extensions==4.1.1 +typing_extensions==4.2.0 From cf644b413e3c143330bd857648ff6811feb5f1d0 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 22 Apr 2022 11:16:41 +0200 Subject: [PATCH 2/2] [test.pyright] suppress unneeded error & warning messages Signed-off-by: Markus Heiser --- manage | 1 + searx/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/manage b/manage index 9e5b59fc7..cfba8aea8 100755 --- a/manage +++ b/manage @@ -702,6 +702,7 @@ test.pyright() { pyenv.cmd npx --no-install pyright -p pyrightconfig-ci.json \ | grep -v ".py$" \ | grep -v '/engines/.*.py.* - warning: "logger" is not defined'\ + | grep -v '/plugins/.*.py.* - error: "logger" is not defined'\ | grep -v '/engines/.*.py.* - warning: "supported_languages" is not defined' \ | grep -v '/engines/.*.py.* - warning: "language_aliases" is not defined' dump_return $? diff --git a/searx/utils.py b/searx/utils.py index ffc9a39d6..abc330be2 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -372,7 +372,7 @@ def _get_lang_to_lc_dict(lang_list: List[str]) -> Dict[str, str]: # babel's get_global contains all sorts of miscellaneous locale and territory related data # see get_global in: https://github.com/python-babel/babel/blob/master/babel/core.py -def _get_from_babel(lang_code: str, key: str): +def _get_from_babel(lang_code: str, key): match = get_global(key).get(lang_code.replace('-', '_')) # for some keys, such as territory_aliases, match may be a list if isinstance(match, str):