Skip to content

DOC: urllib.parse.urlparse() example doesn't parse the params #129745

@wjandrea

Description

@wjandrea

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse

>>> urlparse("scheme://netloc/path;parameters?query#fragment")
ParseResult(scheme='scheme', netloc='netloc', path='/path;parameters', params='',
            query='query', fragment='fragment')

I think the problem is here (for v3.13):

if (scheme or '') in uses_params and ';' in url:

I assume scheme isn't a scheme that uses_params, so the params don't get parsed out. On the other hand, https works as expected:

>>> urlparse("https://netloc/path;parameters?query#fragment")
ParseResult(scheme='https', netloc='netloc', path='/path', params='parameters',
            query='query', fragment='fragment')

By the way, the documentation doesn't mention anything about uses_params. Is that an oversight? Should some mention be added?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions