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

MySQLDsn build failed if password contains special character #1467

Open
zh0uquan opened this issue Sep 24, 2024 · 0 comments
Open

MySQLDsn build failed if password contains special character #1467

zh0uquan opened this issue Sep 24, 2024 · 0 comments

Comments

@zh0uquan
Copy link

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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant