Skip to content

Add scgi to urllib.parse.uses_netloc #67824

Open

Description

@anthonyryan1
BPO 23636
Nosy @orsenthil, @vadmium
Files
  • py3bug: Simple testcase demonstrating problem
  • py2bug: Simple testcase demonstrating problem
  • 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 2015-03-11.00:49:52.527>
    labels = ['type-bug', 'library']
    title = 'Add scgi to urllib.parse.uses_netloc'
    updated_at = <Date 2015-03-11.04:16:12.302>
    user = 'https://bugs.python.org/anthonyryan1'

    bugs.python.org fields:

    activity = <Date 2015-03-11.04:16:12.302>
    actor = 'ned.deily'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2015-03-11.00:49:52.527>
    creator = 'anthonyryan1'
    dependencies = []
    files = ['38434', '38435']
    hgrepos = []
    issue_num = 23636
    keywords = []
    message_count = 2.0
    messages = ['237831', '237837']
    nosy_count = 3.0
    nosy_names = ['orsenthil', 'martin.panter', 'anthonyryan1']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23636'
    versions = ['Python 2.7', 'Python 3.4']

    Activity

    1. anthonyryan1 commented on Mar 11, 2015

      anthonyryan1mannequin
      MannequinAuthor

      The scgi protocol is not included in urllib.parse.uses_netloc list, while other less common protocols are (such as gopher).

      I would like to see scgi get added to this list.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 11, 2015
    3. vadmium commented on Mar 11, 2015

      @vadmium
      Member

      See also bpo-16134 for adding RTMP schemes to the registry. However, I wonder if it is time for a more general fix, rather than having an arms race with whatever URL scheme someone dreams up next.

      According to bpo-7904, urlsplit() etc intentially support parsing the //netloc part for arbitrary URL schemes. However when putting it back together, the urlunsplit() etc functions currently cannot assume it is okay to insert an empty netloc “//”, probably because it would break URLs like tel:+1234 or mailto:somebody@example.net.

      There are a bunch of URL-parsing issues floating around which may be able to come together to solve each other:

      • bpo-8339: Round trip stripping empty netloc, apparently closed because the URLs were thought to be invalid (thought I disagree)
      • bpo-15009: Round trip strips empty netloc for yelp:///foo
      • bpo-23505: Round trip stripping netloc considered a security issue
      • bpo-5843: Round trip stripping empty query and fragment strings
      • bpo-22852: Round trip strips empty fragment

      In bpo-22852, I proposed adding a series of has_netloc/query/fragment flags to the SplitResult etc classes. If that was implemented, we would not have to worry about whitelisting “scgi:” or other schemes in “uses_netloc”. Instead, urlsplit() would automatically set SplitResult(has_netloc=True), and urlunsplit() would know to restore the empty “//” netloc string.

    4. transferred this issue fromon Apr 10, 2022
    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

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions