Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

Error calling `read()` on file with single quote in name

Open ipmb opened this issue 1 year ago • 0 comments

I'm running version 2.5.2 and hitting an error that looks like #266. When I call the .read() method on a Sharepoint file with a ' in the filename, I get this response:

{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"web/getFileByServerRelativePath(DecodedUrl='/file_with_'_in_name')/$value\" is not valid."}}}

No error is raised as I would expect, just a string with those contents.

If, instead I call file.get_content().execute_query().value, I get the expected contents.

ipmb avatar Jan 16 '24 22:01 ipmb