LibraryOfCongress / bagit-python

Work with BagIt packages from Python.
http://libraryofcongress.github.io/bagit-python
216 stars 85 forks source link

Allow fetch.txt with file URLs to validate #154

Closed avivace closed 5 months ago

avivace commented 2 years ago

It looks like it passes all the tests (python setup.py test doesn't return any error) and it also succeds to validate the bag I added in https://github.com/LibraryOfCongress/bagit-conformance-suite/pull/14 with this kind of entries in the fetch.txt:

file:///home/avivace/cern/example_bags/source/sachiel.png 42000 sachiel.png

It should effectively fix https://github.com/LibraryOfCongress/bagit-python/issues/153.

The fetch.txt validation now passes when:

if not (all((parsed_url.scheme, parsed_url.netloc)) or parsed_url.scheme == "file"):