From 338965154948b13d560d5cf3ee0bbab5b6e6dcbe Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:08:12 +0100 Subject: [PATCH] fix: name a sign-in page sent for the file list --- install.ps1 | 2 +- install.py | 15 +++++++++++++-- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install.py | 16 ++++++++++++++++ 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/install.ps1 b/install.ps1 index ec3802e36..36236c052 100644 --- a/install.ps1 +++ b/install.ps1 @@ -16,7 +16,7 @@ # and Invoke-WebRequest throws on a cut transfer before the hash is read: # the site's build rewrites this line there (scripts/sitebootstrap.py). $mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." - $defaultInstallSha256 = "ca1c3c0d721787ee0fd9ab750839893d64f9313885dde6c1f88c5174d4281ce0" + $defaultInstallSha256 = "5255181d018ce7020a619c6a31419da0dde862626bc57347cd0299a099e64f11" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index 4b3be9c4d..a345ace17 100644 --- a/install.py +++ b/install.py @@ -4056,9 +4056,20 @@ def fetch_manifest(plat: str) -> dict: try: return _validate_manifest(_fetch_json(url, MAX_MANIFEST_BYTES, "file list"), plat) except ValueError as exc: + words = f"the file list is not valid: {exc}" + if isinstance(exc.__cause__, (json.JSONDecodeError, UnicodeDecodeError)): + # The parser's "Expecting value: line 1 column 1" told no one + # anything, where the full screen names the usual cause. + words = ("what arrived is not a file list: a Wi-Fi sign-in page or a cut " + "download looks like this") EVENTS.emit("error", stage="manifest", reason="invalid", platform=plat, - message=f"the file list is not valid: {exc}") - print(f" The file list for {plat} is not valid: {exc}", file=sys.stderr) + message=words) + print(f" For {display_name(plat)}, {words}.", file=sys.stderr) + if words.startswith("what arrived"): + for line in _address_lines(url): + print(line, file=sys.stderr) + print(" Check the connection (sign in to the Wi-Fi if it asks), then run the " + "same command again.", file=sys.stderr) sys.exit(1) except urllib.error.HTTPError as exc: EVENTS.emit( diff --git a/install.sh b/install.sh index 960eda7b7..0c4263e04 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins # curl or wget stop on a cut transfer before the hash is read: the site's # build rewrites this line there (scripts/sitebootstrap.py). MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." -DEFAULT_INSTALL_SHA256="ca1c3c0d721787ee0fd9ab750839893d64f9313885dde6c1f88c5174d4281ce0" +DEFAULT_INSTALL_SHA256="5255181d018ce7020a619c6a31419da0dde862626bc57347cd0299a099e64f11" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index eca4e3fc3..7470b4532 100644 --- a/install/launchers/index.json +++ b/install/launchers/index.json @@ -27,8 +27,8 @@ { "dest": "roms/ports/retrobios/install.py", "repo_path": "install.py", - "size": 1083967, - "sha256": "ca1c3c0d721787ee0fd9ab750839893d64f9313885dde6c1f88c5174d4281ce0", + "size": 1084625, + "sha256": "5255181d018ce7020a619c6a31419da0dde862626bc57347cd0299a099e64f11", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1137594, - "sha256": "433caee0f48148c8c25122e3cfa4a6d4577160a2b4ddcf2267415ebd21beb843" + "size": 1138252, + "sha256": "bc75188e7d115aa35066fba281deb2bec5ce07553ebdbe2d8444d0dbdfc5d41d" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1083967, - "sha256": "ca1c3c0d721787ee0fd9ab750839893d64f9313885dde6c1f88c5174d4281ce0", + "size": 1084625, + "sha256": "5255181d018ce7020a619c6a31419da0dde862626bc57347cd0299a099e64f11", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1083967, - "sha256": "ca1c3c0d721787ee0fd9ab750839893d64f9313885dde6c1f88c5174d4281ce0", + "size": 1084625, + "sha256": "5255181d018ce7020a619c6a31419da0dde862626bc57347cd0299a099e64f11", "executable": false }, { diff --git a/tests/test_install.py b/tests/test_install.py index c42477b7d..16c784f2c 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -2404,6 +2404,22 @@ class FileListsAreRetried(unittest.TestCase): self.assertIs(result, missing) self.assertEqual(len(calls), 1) + def test_a_sign_in_page_is_named(self): + """A Wi-Fi sign-in page read as "invalid file list: Expecting value: + line 1 column 1 (char 0)", with no cause and no next step.""" + page = io.BytesIO(b"Sign in to Hotel WiFi") + page.headers = {} + err = io.StringIO() + with unittest.mock.patch.object( + install.urllib.request, "urlopen", + lambda url, timeout=None: contextlib.nullcontext(page)), \ + contextlib.redirect_stderr(err), self.assertRaises(SystemExit): + install.fetch_manifest("retroarch") + said = err.getvalue() + self.assertIn("a Wi-Fi sign-in page or a cut download looks like this", said) + self.assertIn("run the same command again", said) + self.assertNotIn("Expecting value", said) + def test_three_failures_end_with_advice(self): import urllib.error