Skip to content

url_regex doesn't correctly match all allowed characters in a URI #1142

@jonathanunderwood

Description

@jonathanunderwood

Bug

from pydantic.networks import url_regex
m=url_regex.match("postgresql+psycopg2://postgres:postgres@localhost:5432/hatch")
parts = m.groupdict()
parts

produces the following incorrect matching:

{'scheme': None,
 'user': 'postgresql+psycopg2',
 'password': '//postgres:postgres',
 'ipv4': None,
 'ipv6': None,
 'domain': 'localhost',
 'port': '5432',
 'path': '/hatch',
 'query': None,
 'fragment': None}

This is with Python 3.7.5 on OSX, pydantic version 1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug V1Bug related to Pydantic V1.Xhelp wantedPull Request welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions