fix(download): retrieve full folder to resolve type error
Retrieve the full Folder object from FoldersApi instead of using the FolderSimple returned by find_sub_folder when resolving DOI subfolders. This fixes a type checker error under the upgraded pyright, and avoids a potential AttributeError at runtime due to FolderSimple lacking the path attribute. Also upgrade dependencies and bump version to 1.3.16 in pyproject.toml.
This commit is contained in:
@@ -98,9 +98,10 @@ class DownloadCommand(BaseCommand):
|
||||
cls.__multiple_download(connection, context)
|
||||
return
|
||||
else:
|
||||
folder = r_parent_folder.find_sub_folder(r_basename)
|
||||
if folder is None:
|
||||
folder_simple = r_parent_folder.find_sub_folder(r_basename)
|
||||
if folder_simple is None:
|
||||
raise IllegalArgumentException(f"File or folder `{subpath_clean}` not found.")
|
||||
folder = FoldersApi(connection).retrieve(folder_simple.id)
|
||||
is_folder = True
|
||||
|
||||
# For a DOI target the whole folder is the download target.
|
||||
|
||||
Reference in New Issue
Block a user