1414from posixpath import basename , dirname , join as urljoin , splitext
1515from pprint import pformat
1616from typing import Callable , Dict , List , TYPE_CHECKING , Union
17- from urllib .parse import urlparse
17+ from urllib .parse import unquote , urlparse
1818from uuid import uuid4
1919from zipfile import ZipFile
2020
@@ -173,8 +173,12 @@ def _files(self):
173173 if not file .path == self .metadata_path :
174174 if not str (file .path ).endswith ('/' ): # checking for folders, shouldn't have to do this
175175 file_checksum_path = file .path .split (self ._resource_path , 1 )[1 ].strip ("/" )
176- file_path = file_checksum_path .split ("data/contents/" )[1 ]
177- f = File (file_path , file .path , self ._checksums [file_checksum_path ])
176+ file_path = unquote (
177+ file_checksum_path .split (
178+ "data/contents/" ,
179+ )[1 ]
180+ )
181+ f = File (file_path , unquote (file .path ), self ._checksums [file_checksum_path ])
178182 self ._parsed_files .append (f )
179183 return self ._parsed_files
180184
@@ -188,7 +192,7 @@ def populate_metadata(_aggr):
188192 self ._parsed_aggregations = []
189193 for file in self ._map .describes .files :
190194 if is_aggregation (str (file )):
191- self ._parsed_aggregations .append (Aggregation (file .path , self ._hs_session , self ._checksums ))
195+ self ._parsed_aggregations .append (Aggregation (unquote ( file .path ) , self ._hs_session , self ._checksums ))
192196
193197 # load metadata for all aggregations (metadata is needed to create any typed aggregation)
194198 with ThreadPoolExecutor () as executor :
0 commit comments