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

URL decode path for files #17

Open
penberg opened this issue Oct 18, 2023 · 4 comments
Open

URL decode path for files #17

penberg opened this issue Oct 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@penberg
Copy link
Contributor

penberg commented Oct 18, 2023

We currently don't support paths that have URL encoded spaces, for example:

file:///foo/bar%20baz/sqlite.db

Let's decode the URL before passing using it for path lookup.

@penberg penberg added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Oct 18, 2023
@gh-adithya
Copy link

Hi! I would like to work on this issue as my first contribution. Can I go ahead?

@penberg
Copy link
Contributor Author

penberg commented Oct 19, 2023

@gh-adithya Go for it!

@gh-adithya
Copy link

If I'm not wrong, this issue must have been resolved already. The relevant lines of code are:

 url_parsed = urllib.parse.urlparse(url)
 scheme = url_parsed.scheme
 authority = url_parsed.netloc
 path = url_parsed.path

This is from lines 21-24 in config.py

@penberg
Copy link
Contributor Author

penberg commented Oct 19, 2023

@gh-adithya The path is still in the encoded format. You can test this yourself by trying to open a file with a space in the name in encoded format as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants