ship_cc.read owns its unreadable-path refusal, naming no path

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-22 20:23:37 +02:00
commit fbf88e85c5

View file

@ -119,7 +119,10 @@ class ShipFile(NamedTuple):
def read(path: str, cultlib_packages: str) -> ShipFile:
cultcache, msgpack = _libraries(cultlib_packages)
store = cultcache.SingleFileMessagePackBackingStore(path)
envelopes = store.pull_all()
try:
envelopes = store.pull_all()
except OSError as error:
raise ValueError(f"The ship file cannot be read: {error.strerror}") from None
ships = [envelope for envelope in envelopes if envelope.type == SCHEMA]
hulls = [envelope for envelope in envelopes if envelope.type == HULL_SCHEMA]
# Before S1 the hull lived inside the ship record. Saving such a file would preserve the stale hull under a ship that