diff --git a/bikeshed/update/__init__.py b/bikeshed/update/__init__.py index 091de1d010..557be3ac10 100644 --- a/bikeshed/update/__init__.py +++ b/bikeshed/update/__init__.py @@ -1,5 +1,5 @@ from .main import fixupDataFiles, update, updateReadonlyDataFiles -from .manifest import createManifest +from .manifest import Manifest, createManifest from .mode import UpdateMode __all__ = [ diff --git a/bikeshed/update/manifest.py b/bikeshed/update/manifest.py index e82771dfcc..40a9c5ad03 100644 --- a/bikeshed/update/manifest.py +++ b/bikeshed/update/manifest.py @@ -99,13 +99,14 @@ def updateByManifest(path: str, dryRun: bool = False, updateMode: UpdateMode = U m.say("Fetching remote manifest data...") try: - remoteManifest = Manifest.fromString(requests.get(ghPrefix + "manifest.txt", timeout=5).text) + remoteManifestText = requests.get(ghPrefix + "manifest.txt", timeout=5).text except Exception as e: m.warn( f"Couldn't download remote manifest file, so can't update. Please report this!\n{e}", ) - m.warn("Update manually with `bikeshed update --skip-manifest`.") + m.warn("If absolutely necessary, you can update manually with `bikeshed update --skip-manifest`.") return None + remoteManifest = Manifest.fromString(remoteManifestText) if remoteManifest is None: m.die("Something's gone wrong with the remote data; I can't read its timestamp. Please report this!") @@ -297,8 +298,10 @@ def legacyFromString(text: str) -> Manifest | None: lines = text.split("\n") if len(lines) < 10: # Something's definitely borked - msg = "Manifest is too short to possibly be valid." - raise ValueError(msg) + m.warn( + f"Error when parsing manifest: manifest is {len(lines)} long, which is too short to possibly be valid. Please report this!\nEntire manifest:\n{text}", + ) + return None dt = parseDt(lines[0].strip()) if dt is None: return None