GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — nturl2path: drive definition · Issue #88973 · python/cpython

nturl2path: drive definition #88973

New issue
Copy link
New issue
Copy link
Open
Open
nturl2path: drive definition#88973
Copy link
Labels
3.11only security fixesonly security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

NickVeld
mannequin
opened on Aug 2, 2021
Issue body actions
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

      @NickVeld
      NickVeldmannequin
      on Aug 2, 2021
      MannequinAuthor
      More actions

      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 (

      cpython/Lib/nturl2path.py

      Line 30 in 414dcb1

      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
      added
      3.11only security fixesonly security fixes
      OS-windows
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      on Aug 2, 2021
    3. NickVeld commented on Aug 2, 2021

      @NickVeld
      NickVeldmannequin
      on Aug 2, 2021
      MannequinAuthor
      More actions

      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...

    4. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    5. iritkatriel
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard 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 fixesonly security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402520 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.