Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Addresses #115: Removes any unicode symbols from path #137

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/onedrivesdk/extensions/drive_request_builder_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@

def item_by_path(self, path):
"""Get an item by path in OneDrive

Args
path (str): The path to the requested item

Returns:
Returns:
:class:`ItemRequestBuilder<onedrivesdk.requests.item_request_builder.ItemRequestBuilder>`:
A request builder for an item given a path
"""
#strip any leading '/'
path = str(path)[1:] if str(path)[0] == "/" else str(path)
path = str(path.encode("ascii", "ignore").decode("utf8"))[1:] if str(path.encode(
"ascii", "ignore").decode("utf8"))[0] == "/" else str(path.encode("ascii", "ignore").decode("utf8"))
return ItemRequestBuilder(self.append_to_request_url("root:/"+str(path)+":"), self._client)

DriveRequestBuilder.item_by_path = item_by_path