Skip to content

400 error when downloading files with special characters in the name #874

Open
@tomwagstaff-opml

Description

@tomwagstaff-opml

Low priority request since I have a workaround.

If I try to download a file using the File.open_binary method like this:

with open("my_local_filepath", "wb") as output_file:
    response = File.open_binary(client_context, file_url)
    output_file.write(response.content)

and the file has a special character in the name (in my case a ') the download fails with a 400 error: HTTPError: 400 Client Error: Bad Request for url... Wrapping the url with urllib.parse.quote doesn't help.

Not sure if this approach is deprecated anyway since I can't find it in the examples. When I do use the new download method it works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions