Skip to content

Update os.path for PEP 519/__fspath__() #71711

Closed

Description

@brettcannon
BPO 27524
Nosy @brettcannon, @ned-deily, @ethanfurman
Dependencies
  • bpo-26027: Support Path objects in the posix module
  • bpo-27184: Support path objects in the ntpath module
  • Files
  • fspath_tests.diff
  • os_path.diff: Tests and fixes not involving stat or lstat
  • 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 = 'https://github.com/brettcannon'
    closed_at = <Date 2016-08-26.21:46:15.496>
    created_at = <Date 2016-07-15.21:06:32.888>
    labels = ['type-bug', 'library', 'release-blocker']
    title = 'Update os.path for PEP 519/__fspath__()'
    updated_at = <Date 2016-09-06.22:59:12.300>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2016-09-06.22:59:12.300>
    actor = 'python-dev'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2016-08-26.21:46:15.496>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2016-07-15.21:06:32.888>
    creator = 'brett.cannon'
    dependencies = ['26027', '27184']
    files = ['43740', '43941']
    hgrepos = []
    issue_num = 27524
    keywords = ['patch']
    message_count = 6.0
    messages = ['270513', '270519', '271645', '271654', '273733', '274655']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'ned.deily', 'ethan.furman', 'python-dev']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27524'
    versions = ['Python 3.6']

    Activity

    1. brettcannon commented on Jul 15, 2016

      @brettcannon
      MemberAuthor

      As per PEP-519, os.path needs to be updated to support __fspath__().

    2. self-assigned this
      on Jul 15, 2016
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jul 15, 2016
    4. brettcannon commented on Jul 15, 2016

      @brettcannon
      MemberAuthor

      Here are tests for genericpath, posixpath, and ntpath (which should in the end cover all of os.path).

    5. brettcannon commented on Jul 29, 2016

      @brettcannon
      MemberAuthor

      Ran into the first nasty snag: people are abusing os.path.commonprefix() and it's extremely generic approach. Instead of passing in a list of file paths they are passing a list of lists of file path *parts*, e.g. instead of ["a/b", "a/c"] they are passing in [["a", "b"], ["a", "c"]]. I have special-cased when the list contains another list or tuple, but I still feel dirty doing it.

    6. brettcannon commented on Jul 29, 2016

      @brettcannon
      MemberAuthor

      Here is a patch that includes the previous tests as long with fixes which don't involve stat or lstat (once those functions are updated themselves then os.path will be ported).

    7. python-dev commented on Aug 26, 2016

      python-devmannequin
      Mannequin

      New changeset b64f83d6ff24 by Brett Cannon in branch 'default':
      Issue bpo-26027, bpo-27524: Add PEP 519/fspath() support to os and
      https://hg.python.org/cpython/rev/b64f83d6ff24

    8. python-dev commented on Sep 6, 2016

      python-devmannequin
      Mannequin

      New changeset 9be0286772bf by Brett Cannon in branch 'default':
      Issue bpo-26027, bpo-27524: Document the support for path-like objects in os and os.path.
      https://hg.python.org/cpython/rev/9be0286772bf

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

    Labels

    release-blockerstdlibStandard 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