tursodatabase / libsql-client-py

Python SDK for libSQL
https://libsql.org/libsql-client-py/
MIT License
44 stars 10 forks source link

URL decode path for files #17

Open penberg opened 11 months ago

penberg commented 11 months ago

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.

gh-adithya commented 11 months ago

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

penberg commented 11 months ago

@gh-adithya Go for it!

gh-adithya commented 11 months ago

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 commented 11 months ago

@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.