Skip to content

urllib.parse doesn't fully comply to RFC 3986 #78541

Closed

Description

@The-Compiler
BPO 34360
Nosy @orsenthil, @The-Compiler, @native-api, @howinator, @RJ722, @tirkarthi, @websurfer5

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2018-08-08.16:02:35.342>
labels = ['3.7', '3.8', 'type-bug', 'library']
title = "urllib.parse doesn't fully comply to RFC 3986"
updated_at = <Date 2020-08-07.06:49:54.821>
user = 'https://github.com/The-Compiler'

bugs.python.org fields:

activity = <Date 2020-08-07.06:49:54.821>
actor = 'Jeffrey.Kintscher'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2018-08-08.16:02:35.342>
creator = 'The Compiler'
dependencies = []
files = []
hgrepos = []
issue_num = 34360
keywords = []
message_count = 2.0
messages = ['323292', '323362']
nosy_count = 7.0
nosy_names = ['orsenthil', 'The Compiler', 'Ivan.Pozdeev', 'Howie Benefiel', 'RJ722', 'xtreak', 'Jeffrey.Kintscher']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue34360'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

Activity

  1. The-Compiler commented on Aug 8, 2018

    The-Compilermannequin
    MannequinAuthor

    Since bpo-29651, the urllib.parse docs say:

    Unmatched square brackets in the netloc attribute will raise a ValueError.

    However, when there are at least one [ and ], but they don't match, there's somewhat inconsistent behavior:

    >>> urllib.parse.urlparse('http://[::1]]').hostname
    '::1'
    >>> urllib.parse.urlparse('http://[[::1]').hostname
    '[::1'
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or error
    on Aug 8, 2018
  3. native-api commented on Aug 10, 2018

    native-apimannequin
    Mannequin

    I confirm violation of https://tools.ietf.org/html/rfc3986#section-3.2.2 .

    URLs are now covered by RFC 3986 which obsoletes RFC 1808 that `urllib's documentation refers to.

    This new URL RFC adds [] to 'reserved' characters, so them being present unquoted anywhere where reserved characters are not allowed shall be a parsing error.

  4. changed the title [-]urllib.parse doesn't fail with multiple unmatching square brackets[/-] [+]urllib.parse doesn't fully comply to RFC 3986[/+] on Aug 10, 2018
  5. transferred this issue fromon Apr 10, 2022
  6. picnixz commented on Feb 17, 2025

    @picnixz
    Member

    I'm going to close this one then as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.7 (EOL)end of life3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions