calamari.io.base.read_signature_lines#
- calamari.io.base.read_signature_lines(path)#
Read exactly the leading lines a loader’s
sniffinspects.The counterpart to
LoaderRegistry.detect(), which swallows read errors to stay usable as a directory-walk probe: this one lets them propagate, so a caller that must distinguish “unreadable file” from “readable but unrecognised file” can.calamari.io.load()is exactly that caller – it reads here (lettingFileNotFoundErrorand friends through untouched) and only then asksLoaderRegistry.detect_lines()whether any loader claims the content.