pydantic-core
pydantic-core copied to clipboard
MySQLDsn build failed if password contains special character
Hello, running the following code to build mysql url will cause a error when password contains a special character #.
from pydantic import MySQLDsn
MySQLDsn.build(
scheme="mysql+aiomysql",
username="test",
password="test#1",
host="127.0.0.1",
port=3306,
path="test"
)
this is the error message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pydantic_core._pydantic_core.ValidationError: 1 validation error for url
Input should be a valid URL, invalid port number [type=url_parsing, input_value='mysql+aiomysql://test:test#[email protected]:3306/test', input_type=str]