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

urllib.parse.urlsplit() must not lowercase() IPv6 scope value #76504

Closed
socketpair mannequin opened this issue Dec 14, 2017 · 7 comments
Closed

urllib.parse.urlsplit() must not lowercase() IPv6 scope value #76504

socketpair mannequin opened this issue Dec 14, 2017 · 7 comments
Labels
3.7 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@01e27b45-90f2-4c74-9e5e-7e7e54c3d78e
Copy link
Mannequin

socketpair mannequin commented Dec 14, 2017

BPO 32323
Nosy @bitdancer, @asvetlov, @socketpair
PRs
  • bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value #4867
  • [3.6] bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (GH-4867) #4959
  • 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 = <Date 2017-12-21.12:58:46.744>
    created_at = <Date 2017-12-14.15:30:39.799>
    labels = ['3.7', 'type-bug', 'library']
    title = 'urllib.parse.urlsplit() must not lowercase() IPv6 scope value'
    updated_at = <Date 2017-12-21.17:19:58.223>
    user = 'https://github.com/socketpair'

    bugs.python.org fields:

    activity = <Date 2017-12-21.17:19:58.223>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-12-21.12:58:46.744>
    closer = 'asvetlov'
    components = ['Library (Lib)']
    creation = <Date 2017-12-14.15:30:39.799>
    creator = 'socketpair'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32323
    keywords = ['patch']
    message_count = 7.0
    messages = ['308306', '308326', '308328', '308329', '308870', '308871', '308886']
    nosy_count = 3.0
    nosy_names = ['r.david.murray', 'asvetlov', 'socketpair']
    pr_nums = ['4867', '4959']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32323'
    versions = ['Python 3.6', 'Python 3.7']

    @01e27b45-90f2-4c74-9e5e-7e7e54c3d78e
    Copy link
    Mannequin Author

    socketpair mannequin commented Dec 14, 2017

    qwe = urlsplit('http://[FE80::822a:a8ff:fe49:470c%Тест]:1234/keys')
    qwe.hostname will be 'fe80::822a:a8ff:fe49:470c%тест'

    Which is wrong.

    correct value is

    'fe80::822a:a8ff:fe49:470c%Тест'

    so, IP-address is lowercased and zone id does not.

    @01e27b45-90f2-4c74-9e5e-7e7e54c3d78e socketpair mannequin added 3.8 only security fixes 3.7 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 14, 2017
    @bitdancer
    Copy link
    Member

    In quick search the only RFC reference to this I found was https://tools.ietf.org/id/draft-sweet-uri-zoneid-01.html, which doesn't match what you are requesting (not that urlsplit's current behavior matches that either).

    Do you have RFC references?

    @01e27b45-90f2-4c74-9e5e-7e7e54c3d78e
    Copy link
    Mannequin Author

    socketpair mannequin commented Dec 14, 2017

    https://url.spec.whatwg.org/#host-representation -> Support for <zone_id> is intentionally omitted.

    https://tools.ietf.org/html/rfc6874

    @01e27b45-90f2-4c74-9e5e-7e7e54c3d78e
    Copy link
    Mannequin Author

    socketpair mannequin commented Dec 14, 2017

    Also this:

    http://potaroo.net/ietf/idref/draft-kitamura-ipv6-zoneid-free/

    So, I'm confused. Will investigate.

    @asvetlov
    Copy link
    Contributor

    New changeset fdb148f by Andrew Svetlov (Miss Islington (bot)) in branch '3.6':
    bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (GH-4867) (bpo-4959)
    fdb148f

    @asvetlov
    Copy link
    Contributor

    RFC doesn't specify a case for Zone ID, let's keep it untouched (no lowercasing)

    @asvetlov asvetlov removed the 3.8 only security fixes label Dec 21, 2017
    @bitdancer
    Copy link
    Member

    I don't think a zone id in that form is actually valid in a URI, but I agree that not messing with whatever is there is probably the best policy as long as we aren't directly supporting whatever *is* valid.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants