-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I rather work with pathlib and Path objects than with raw string paths. Today I stumbled upon two problems trying to use download_and_extract() from the apps module.
filepathandoutput_dirparameters don't get Path objects and it generates:
AttributeError: 'PosixPath' object has no attribute 'rstrip'
Wrapping them by str() helps to avoid the error.
As it is shown in the docs to use string, I think it would be good to have wider possibilities with that, especially with such broadly used lib as pathlib. An alternative to that would be a more precise error note.
filepathparameter cause a RuntimeError when just a directory path with no file name and extension is given. What is confusing the error if pointing towardshash_valparameter and not the one it should.
RuntimeError: md5 check of existing file failed: filepath=/home/user/MEDnist/mednist_practice_1/notebooks/../mnist_data, expected md5=0bc7306e7427e00ad1c5526a6677552d.
It would be comfortable to use just a directory path and get the file name and its extension from the file downloaded. I see a problem here when having no knowledge of what an extension of the downloading file is. An alternative, same as before, is to have a more clear error description pointing the problem itself.