From 8d1e002dfbc9546a983c0ab9471f476a31747fb8 Mon Sep 17 00:00:00 2001 From: grdddj Date: Mon, 12 Feb 2024 14:29:56 +0100 Subject: [PATCH] chore(python): include error when wanting to upload a JSON file as a translation payload [no changelog] --- python/src/trezorlib/cli/settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/src/trezorlib/cli/settings.py b/python/src/trezorlib/cli/settings.py index 24f91ed2a..635ffe507 100644 --- a/python/src/trezorlib/cli/settings.py +++ b/python/src/trezorlib/cli/settings.py @@ -224,6 +224,11 @@ def language( language_data = b"" else: assert path_or_url is not None + if path_or_url.endswith(".json"): + raise click.ClickException( + "Provided file is a JSON file, not a blob file.\n" + "Generate blobs by running `python core/translations/cli.py gen` in root." + ) try: language_data = Path(path_or_url).read_bytes() except Exception: