Skip to content

404 error with get_file_by_server_relative_path in version 2.4.2 onwards #722

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

Closed
dslemusp opened this issue Aug 7, 2023 · 4 comments
Closed
Labels

Comments

@dslemusp
Copy link

dslemusp commented Aug 7, 2023

It seems there is a regression in version 2.4.3 using the get_file_by_server_relative_path

using

relative_path = "/sites/mysite/folder/filename.ext"
ctx = ClientContext(site_url).with_credentials(credentials)
file = ctx.web.get_file_by_server_relative_path(relative_path).get().execute_query()

with 2.4.1 gave no problems and updating to 2.4.3 get the error HTTPError: 404 Client Error: Resource Not Found for url... It seems the url that is being requested is wrongly parsed (now including twice the "/sites/mysite"), which I think is related to changes introduced in 2.4.2

@vgrem vgrem added the bug label Aug 8, 2023
@helingai
Copy link

helingai commented Sep 3, 2023

Can confirm. Downgrading to 2.4.1 fixes this issue.

@vgrem
Copy link
Owner

vgrem commented Sep 3, 2023

Thank you for catching and reporting this bug, it has been addressed in a new version 2.4.4

@vgrem vgrem closed this as completed Sep 3, 2023
@helingai
Copy link

helingai commented Sep 3, 2023

I can confirm it's fixed. Thanks very much!

@dslemusp
Copy link
Author

thx! guys!

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

3 participants