Skip to content

Commit cc9b366

Browse files
authored
Allow fetch.txt with file URLs to validate (#154)
1 parent 33d6376 commit cc9b366

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bagit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,9 @@ def validate_fetch(self):
774774
# well formed:
775775
parsed_url = urlparse(url)
776776

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

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

0 commit comments

Comments
 (0)