New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requests MissingSchema Error when downloading file #271
Comments
There is a bug in 2.2.1 version you either need to use latest from git or fix it manually in your installation here https://github.com/vgrem/Office365-REST-Python-Client/blob/master/office365/sharepoint/files/file.py#L275 Note that in you version |
Thank you @efremovd and @etiennecelery for catching and pinpoint it, indeed it is a bug and is encountered in version As was mentioned, the latest version available from GitHub resolves this issue:
Alternatively, the file could be downloaded as demonstrated below: file_url = '{server-relative-path-to-download}'
with open(download_path, "wb") as local_file:
file = ctx.web.get_file_by_server_relative_url(file_url).download(local_file).execute_query() |
Thank you!! Great work |
Closing this one since has been resolved and |
Works like a charm. Nice work! |
Hi!
I'm having trouble downloading a file from SharePoint using the latest 2.2.1 version of Office365. When I try to download a file a "MissingSchema" Error from the requests module appears. I don't know what happened, if I go back to version 2.1.5 the code runs fine. Thank you very much and I appreciate the hard work in this module; super useful!
Error:
MissingSchema: Invalid URL "<bound method ClientContext.service_root_url of <office365.sharepoint.client_context.ClientContext object at 0x7fb4e44c3d90>>web/getfilebyserverrelativeurl('MYRELATIVEURL')/\\$value": No schema supplied. Perhaps you meant http://<bound method ClientContext.service_root_url of <office365.sharepoint.client_context.ClientContext object at 0x7fb4e44c3d90>>web/getfilebyserverrelativeurl('MYRELATIVEURL')/\$value?
Using MacOS,
Office365 2.2.1,
Python 3.8.3,
requests 2.2.4
The text was updated successfully, but these errors were encountered: