Skip to content

Commit 796226a

Browse files
committed
Revert "remove unquote"
This reverts commit 07389e8.
1 parent 07389e8 commit 796226a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

hsclient/hydroshare.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from posixpath import basename, dirname, join as urljoin, splitext
1515
from pprint import pformat
1616
from typing import Callable, Dict, List, TYPE_CHECKING, Union
17-
from urllib.parse import urlparse
17+
from urllib.parse import unquote, urlparse
1818
from uuid import uuid4
1919
from 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

Comments
 (0)