You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
call method YaDisk.upload(localpath, yandexFolder, overwrite=True)
Actual behaviour:
Exception raised: Message=По указанному пути "disk:/Изображения/SanochkiInteractive/Test Folder" уже существует папка с таким именем. (Specified path "disk:/Изображения/SanochkiInteractive/Test Folder" points to existent directory. / DiskPathPointsToExistentDirectoryError)
Source=C:\Users\al-gerasimov\source\repos\Chronica\yaHelper.py
StackTrace:
File "C:\Users\al-gerasimov\source\repos\Chronica\yaHelper.py", line 51, in saveFileTo
y.upload(localpath, credentials.main_dirrectory + "/" + yandexFolder, overwrite=TRUE)
File "C:\Users\al-gerasimov\source\repos\Chronica\bot.py", line 25, in callback_query (Current frame)
saveFileTo(os.path.join(dst, entry), call.data)
yadisk.exceptions.DirectoryExistsError: По указанному пути "disk:/Изображения/SanochkiInteractive/Test Folder" уже существует папка с таким именем. (Specified path "disk:/Изображения/SanochkiInteractive/Test Folder" points to existent directory. / DiskPathPointsToExistentDirectoryError)
Expected:
Now exceptions and file was uploaded to existed folder in Yandex Disk
Also, repository haven't test cases cover such cases.
If owner haven't resources for fix issue, I'll start work on it soon.
Thanks
The text was updated successfully, but these errors were encountered:
The overwrite parameter is not ignored, it's just that you can't overwrite folders.
This isn't really a bug, this is just how the Yandex.Disk's REST API works. Getting an error in this case makes perfect sense. You are supposed to provide the full destination path, not just the parent folder.
Expected:
No exceptions and file was uploaded to existing folder in Yandex Disk
Introducing the suggested behavior would only make the method less consistent and could lead to silent accidents (e.g. accidentally uploading into a folder instead of overwriting what was assumed to be a file).
Steps to reproduce
Actual behaviour:
Exception raised:
Message=По указанному пути "disk:/Изображения/SanochkiInteractive/Test Folder" уже существует папка с таким именем. (Specified path "disk:/Изображения/SanochkiInteractive/Test Folder" points to existent directory. / DiskPathPointsToExistentDirectoryError)
Source=C:\Users\al-gerasimov\source\repos\Chronica\yaHelper.py
StackTrace:
File "C:\Users\al-gerasimov\source\repos\Chronica\yaHelper.py", line 51, in saveFileTo
y.upload(localpath, credentials.main_dirrectory + "/" + yandexFolder, overwrite=TRUE)
File "C:\Users\al-gerasimov\source\repos\Chronica\bot.py", line 25, in callback_query (Current frame)
saveFileTo(os.path.join(dst, entry), call.data)
yadisk.exceptions.DirectoryExistsError: По указанному пути "disk:/Изображения/SanochkiInteractive/Test Folder" уже существует папка с таким именем. (Specified path "disk:/Изображения/SanochkiInteractive/Test Folder" points to existent directory. / DiskPathPointsToExistentDirectoryError)
Expected:
Now exceptions and file was uploaded to existed folder in Yandex Disk
Also, repository haven't test cases cover such cases.
If owner haven't resources for fix issue, I'll start work on it soon.
Thanks
The text was updated successfully, but these errors were encountered: