Skip to content

Commit

Permalink
Addresses OneDrive#115: Removes any unicode symbols from path.
Browse files Browse the repository at this point in the history
  • Loading branch information
DataSapient committed Oct 4, 2018
1 parent e5642f8 commit d99aef1
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit d99aef1

Please sign in to comment.