Skip to content

Commit

Permalink
Allow fetch.txt with file URLs to validate (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
avivace authored Mar 22, 2024
1 parent 33d6376 commit cc9b366
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bagit.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,9 @@ def validate_fetch(self):
# well formed:
parsed_url = urlparse(url)

if not all((parsed_url.scheme, parsed_url.netloc)):
# each parsed url must resolve to a scheme and point to a netloc
# if the scheme is file, netloc is not necessary
if not (all((parsed_url.scheme, parsed_url.netloc)) or parsed_url.scheme == "file"):
raise BagError(_("Malformed URL in fetch.txt: %s") % url)

def _validate_contents(self, processes=1, fast=False, completeness_only=False):
Expand Down

0 comments on commit cc9b366

Please sign in to comment.