Skip to content

nturl2path: drive definition #88973

Open
Open

Description

@NickVeld
mannequin
BPO 44810
Nosy @pfmoore, @tjguk, @zware, @zooba, @NickVeld
PRs
  • bpo-44810: raise error on several drive letters in url2pathname #27552
  • 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 2021-08-02.12:24:05.800>
    labels = ['type-bug', 'OS-windows', '3.11']
    title = 'nturl2path: drive definition'
    updated_at = <Date 2021-08-02.13:12:06.776>
    user = 'https://github.com/NickVeld'

    bugs.python.org fields:

    activity = <Date 2021-08-02.13:12:06.776>
    actor = 'NickVeld'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Windows']
    creation = <Date 2021-08-02.12:24:05.800>
    creator = 'NickVeld'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44810
    keywords = ['patch']
    message_count = 2.0
    messages = ['398761', '398764']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'NickVeld']
    pr_nums = ['27552']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue44810'
    versions = ['Python 3.11']

    Activity

    1. NickVeld commented on Aug 2, 2021

      NickVeldmannequin
      MannequinAuthor

      Due some problem in a third-party package the url2path function from nturl2path got a/"https://b" (without , a,b` are just masks ) as the first and only argument.

      In the function there is the following code (

      comp = url.split('|')
      ; current state of the main branch):

      comp = url.split('|')
      if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
          error = 'Bad URL: ' + url
          raise OSError(error)
      drive = comp[0][-1].upper()
      

      As a result, the function decided that the file was located on the `S:` drive and returned the `S:\b` path without a warning.
      To my mind, it is not right to take just the last letter as a drive letter because the returned path must be only for the specified URL and the unsupported ones must be marked as "bad" without any silent transformations.

    2. NickVeld commented on Aug 2, 2021

      NickVeldmannequin
      MannequinAuthor

      For the visualization I created a PR with a possible fix. (The link is set into the corresponding field.)

      If everything is OK, I will perform all the required things like the CLA, news entry...

    3. transferred this issue fromon Apr 10, 2022
    4. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 29, 2023
    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.11only security fixesOS-windowsstdlibStandard 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