diff --git a/exceptions.py b/exceptions.py index 81ace96eaa7..6095c88c6a6 100644 --- a/exceptions.py +++ b/exceptions.py @@ -40,6 +40,9 @@ def error_location(self): return [self.arguments['line_number']] return None + def __str__(self): + return f'{self.error_code} {repr(self.arguments)}' + class WarningException(HedyException): """Fixed That For You warning/exception. diff --git a/hedy.py b/hedy.py index cc81fcfa4d9..f769b77e529 100644 --- a/hedy.py +++ b/hedy.py @@ -3612,6 +3612,8 @@ def get_parser(level, lang="en", keep_all_tokens=False, skip_faulty=False): grammar, str(sys.version_info[:2]), str(parser_opts), + # When we upgrade Lark, make sure to not load cached parsers from old versions + str(lark.__version__), )).encode()).hexdigest() cached_parser_file = f"cached-parser-{level}-{lang}-{unique_parser_hash}.pkl" diff --git a/requirements.txt b/requirements.txt index e578f0e0a21..c2ecb0f89d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ Flask==3.0.2 Werkzeug==3.0.6 -lark==1.1.1 +# We cannot go higher than this, because starting 1.2.1+ +# we parse "100" as text instead of a number. +lark==1.1.9 gunicorn==22.0.0 flask-compress==1.4.0 requests==2.32.0 @@ -10,7 +12,7 @@ boto3>=1.16.50 MarkupSafe==2.1.2 ruamel.yaml==0.18.6 docopt==0.6.2 -pydantic==1.10.13 +pydantic==1.10.21 lazy==1.4 PySumTypes==0.0.1 beautifulsoup4==4.9.3