Skip to content

Commit 194b07b

Browse files
author
David Kesselheim
committed
add slash if missing
1 parent 0b2eddf commit 194b07b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

O365/drive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,10 +1658,14 @@ def get_item(self, item_id):
16581658
**{self._cloud_data_key: data})
16591659

16601660
def get_item_by_path(self, item_path):
1661-
""" Returns a DriveItem by it's path: /path/to/file
1661+
""" Returns a DriveItem by it's absolute path: /path/to/file
16621662
:return: one item
16631663
:rtype: DriveItem
16641664
"""
1665+
1666+
if not item_path.startswith("/"):
1667+
item_path = "/" + item_path
1668+
16651669
if self.object_id:
16661670
# reference the current drive_id
16671671
url = self.build_url(

0 commit comments

Comments
 (0)