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
File "...\miniconda3\envs\Automations\Lib\site-packages\O365\drive.py", line 153, in __init__
super().__init__(
File "...\miniconda3\envs\Automations\Lib\site-packages\O365\utils\utils.py", line 344, in __init__
raise ValueError('Protocol not provided to Api Component')
It is worth noting that despite the error, the copy operation still succeeds.
Steps to Reproduce
Attempt to copy a DriveItem from a shared OneDrive using the provided code snippet.
Origin of the Error
Upon inspecting the source code, it was discovered that the protocol is set within the CopyOperation class:
This is invoked from the DriveItem.copy() method with the arguments CopyOperation(parent=self.drive, ...). Further investigation revealed that self.drive is set to None.
Workaround
A temporary workaround for this issue is to wrap the copy statement in a try/except block.
Question
Is there a more elegant solution to address this problem?
The text was updated successfully, but these errors were encountered:
In order for CopyOperation to work, it needs a connection object. The connections objects comes directly from the parent attribute (or con if provided but it's not provided from driveitem.copy):
The latter one is None in case of a shared folder (at least for me):
Maybe the connection object is taken from the parent, but the protocol information is taken from self.drive which is denoted parent in the failing method?
I have a problem copying files in a shared OneDrive.
Error Description
When attempting to copy files from one directory to another in a shared OneDrive using the following Python code:
The following error is encountered:
It is worth noting that despite the error, the copy operation still succeeds.
Steps to Reproduce
Origin of the Error
Upon inspecting the source code, it was discovered that the protocol is set within the CopyOperation class:
This is invoked from the
DriveItem.copy()
method with the argumentsCopyOperation(parent=self.drive, ...)
. Further investigation revealed thatself.drive
is set to None.Workaround
A temporary workaround for this issue is to wrap the copy statement in a try/except block.
Question
Is there a more elegant solution to address this problem?
The text was updated successfully, but these errors were encountered: