Skip to content
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

downloading files from sharepoint breaks with v2.3.6 #399

Closed
josefschabasser opened this issue Aug 24, 2021 · 4 comments
Closed

downloading files from sharepoint breaks with v2.3.6 #399

josefschabasser opened this issue Aug 24, 2021 · 4 comments
Labels

Comments

@josefschabasser
Copy link

josefschabasser commented Aug 24, 2021

Hello! We recently tried to upgrade this library from v2.3.5 to v2.3.6 and downloading files from sharepoint stopped working. We always receive HTTP 404. As soon as we downgrade to v2.3.5 it starts working again.

Here's the code that we are using, trimmed down to the essential part and tested with v2.3.5 (works) and v2.3.6 (breaks).

from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.files.file import File
from office365.runtime.client_request_exception import ClientRequestException

try:
    with open('./test.csv', 'wb') as local_file:
        File.from_url('https://company.sharepoint.com/sites/Demo/path/to/test.csv').with_credentials(
            UserCredential(user_name='[email protected]', password='supersecret')
        ).download(local_file).execute_query()
except ClientRequestException as e:
    msg = 'Sharepoint download failed:'
    print(msg, e.message)

Best regards

@vgrem vgrem added the bug label Aug 24, 2021
@josefschabasser
Copy link
Author

josefschabasser commented Aug 24, 2021

Here's a more detailed error message:

office365.runtime.client_request_exception.ClientRequestException: ('-2130575338, Microsoft.SharePoint.SPException', "Die Datei '/sites/Demo/path/to/test.csv' ist nicht vorhanden.", "404 Client Error: Not Found for url: https://company.sharepoint.com/_api/Web/getFileByServerRelativePath(DecodedUrl='%2Fsites%2FDemo%2Fpath%2Fto%2Ftest.csv')?$select=ServerRelativeUrl")

vgrem added a commit that referenced this issue Aug 25, 2021
@vgrem
Copy link
Owner

vgrem commented Aug 25, 2021

Greetings,

thank you for catching and reporting this issue, it's been confirmed to be a bug related with the order in which query queue is executed.

Anyway the provided error should no longer occur in the latest version which could be grabbed via GitHub:

pip install git+https://github.com/vgrem/Office365-REST-Python-Client.git

and expected to be released in the forthcoming version: 2.3.7

@vgrem
Copy link
Owner

vgrem commented Aug 28, 2021

Resolved in the latest release (v.2.3.7)

@vgrem vgrem closed this as completed Aug 28, 2021
@josefschabasser
Copy link
Author

josefschabasser commented Sep 1, 2021

Keep up the nice work! Successfully tested with version 2.3.7! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants