It should be removed from the path before passing into a Blob constructor.
scheme, netloc, path, query, frag = urlsplit(blob_or_uri)
if scheme != "gs":
raise ValueError("URI scheme must be gs")
blob_name = path[1:]
bucket = Bucket(self, name=netloc)
blob_or_uri = Blob(blob_name, bucket)
blob_or_uri.download_to_file(file_obj, client=self, start=start, end=end)
BTW: I tried to create a pull request to fix it but I was not allowed to push my commit into this repo. How can I contribute?
Client.download_blob_to_file()does not work properly when passing a URI because the parsed path which is passed as a blob name has the initial/.https://github.com/googleapis/google-cloud-python/blob/master/storage/google/cloud/storage/client.py#L389-L395
It should be removed from the path before passing into a Blob constructor.
BTW: I tried to create a pull request to fix it but I was not allowed to push my commit into this repo. How can I contribute?