Closed Johan944 closed 4 years ago
Can you test if this problem also exists if you use SQLAlchemy without dataset? If so, I'd recommend reporting the issue upstream in the SQLAlchemy bug tracker.
Thank you for your quick response !
I already use SQLAlchemy with our url, and there is not any problem with square brackets in password.
I found a solution :
from urllib.parse import quote_plus as urlquote
url = f"mysql://{user}:{urlquote(password)}@{host}/{db_name}"
db = dataset.connect(url)
Ah, interesting, thanks!
Hello, we try to use your module but we met a problem.
When we try to connect with our production database, an error occured : -> File "C:\Users\Johan Ganem--Brunet\Anaconda3\lib\urllib\parse.py", line 459, in urlsplit raise ValueError("Invalid IPv6 URL") ValueError: Invalid IPv6 URL
While in local, there is not problem.
I researched in the Internet, and I found that urllib does not support brackets in URL. So, the password in brackets must to be encode, but when a I did this, a sqlalchemy error occured: -> sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string
Can you think you can fix that ? Thank you :)
Johan