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

Fix "file:" URL to have right no. of /'s #36991

Closed
callenish mannequin opened this issue Aug 6, 2002 · 4 comments
Closed

Fix "file:" URL to have right no. of /'s #36991

callenish mannequin opened this issue Aug 6, 2002 · 4 comments
Labels
stdlib Python modules in the Lib dir

Comments

@callenish
Copy link
Mannequin

callenish mannequin commented Aug 6, 2002

BPO 591713
Nosy @freddrake
Files
  • urlparse.patch
  • 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 2002-09-25.19:22:58.000>
    created_at = <Date 2002-08-06.19:26:03.000>
    labels = ['library']
    title = 'Fix "file:" URL to have right no. of /\'s'
    updated_at = <Date 2002-09-25.19:22:58.000>
    user = 'https://bugs.python.org/callenish'

    bugs.python.org fields:

    activity = <Date 2002-09-25.19:22:58.000>
    actor = 'nnorwitz'
    assignee = 'nnorwitz'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2002-08-06.19:26:03.000>
    creator = 'callenish'
    dependencies = []
    files = ['4487']
    hgrepos = []
    issue_num = 591713
    keywords = ['patch']
    message_count = 4.0
    messages = ['40855', '40856', '40857', '40858']
    nosy_count = 3.0
    nosy_names = ['fdrake', 'nnorwitz', 'callenish']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue591713'
    versions = []

    @callenish
    Copy link
    Mannequin Author

    callenish mannequin commented Aug 6, 2002

    If you run urlparse.urljoin() on a file: URL, the resulting URL
    has together with the wrong number of '/'s in it.

    Properly formed, the URL (assuming no netloc) should have
    three slashes, so that it looks like "file:///...". The current
    code drops that down to one.

    The error appears to be in a condition in urlunsplit(). It
    doesn't show up except in this one instance because the
    test is only run iff the scheme is in the list of those that can
    take a netloc and there is no netloc present in the URL.
    Apparently, this is pretty rare.

    Patch attached that corrects the condition.

    @callenish callenish mannequin closed this as completed Aug 6, 2002
    @callenish callenish mannequin assigned nnorwitz Aug 6, 2002
    @callenish callenish mannequin added the stdlib Python modules in the Lib dir label Aug 6, 2002
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Sep 17, 2002

    Logged In: YES
    user_id=33168

    Not sure who is best to review this? Fred? Jeremy?
    Someone else?

    This patch works for me. I have a test too. Assign back to
    me if you want me to check it in.

    @freddrake
    Copy link
    Member

    Logged In: YES
    user_id=3066

    Looks good to me; go ahead and check it in with the tests.

    Thanks!

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Sep 25, 2002

    Logged In: YES
    user_id=33168

    Checked in as:

    • urlparse.py 1.33 and 1.31.6.2
    • test_urlparse.py 1.7 and 1.2.24.2
    • output/test_urlparse 1.2.24.2

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant