Skip to content

Support the fspath protocol in the posixpath module #71418

Closed

Description

@JelleZijlstra
BPO 27231
Nosy @ethanfurman, @berkerpeksag, @JelleZijlstra
Dependencies
  • bpo-27232: os.fspath() should not use repr() on error
  • Files
  • issue27231.patch: patch adding os.fspath support to numerous posixpath.py functions
  • 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/JelleZijlstra'
    closed_at = <Date 2016-10-06.11:17:16.691>
    created_at = <Date 2016-06-05.16:35:39.581>
    labels = ['type-feature', 'library']
    title = 'Support the fspath protocol in the posixpath module'
    updated_at = <Date 2016-10-06.11:17:16.689>
    user = 'https://github.com/JelleZijlstra'

    bugs.python.org fields:

    activity = <Date 2016-10-06.11:17:16.689>
    actor = 'berker.peksag'
    assignee = 'JelleZijlstra'
    closed = True
    closed_date = <Date 2016-10-06.11:17:16.691>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2016-06-05.16:35:39.581>
    creator = 'JelleZijlstra'
    dependencies = ['27232']
    files = ['43241']
    hgrepos = []
    issue_num = 27231
    keywords = ['patch']
    message_count = 5.0
    messages = ['267428', '267444', '267518', '267531', '278185']
    nosy_count = 4.0
    nosy_names = ['SilentGhost', 'ethan.furman', 'berker.peksag', 'JelleZijlstra']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27231'
    versions = ['Python 3.6']

    Activity

    1. JelleZijlstra commented on Jun 5, 2016

      @JelleZijlstra
      MemberAuthor

      Various functions in posixpath.py need to accept os.PathLike objects. I will submit a patch.

    2. self-assigned this
      on Jun 5, 2016
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jun 5, 2016
    4. JelleZijlstra commented on Jun 5, 2016

      @JelleZijlstra
      MemberAuthor

      This patch adds a number of os.fspath calls to the posixpath.py module. I didn't duplicate all tests to check PathLike objects in addition str/bytes, because that seemed excessive. Instead I tried to ensure that each function has at least one test checking that it accepts PathLike objects.

    5. SilentGhost commented on Jun 6, 2016

      SilentGhostmannequin
      Mannequin

      There seems to be an issue with your patch, it does apply cleanly when doing that manually, but Rietveld doesn't like it. The changes in Lib/posixpath.py and Lib/test/test_posixpath.py don't show up.

    6. JelleZijlstra commented on Jun 6, 2016

      @JelleZijlstra
      MemberAuthor

      I wrote the patch assuming that the error messages would be changed in accordance with bpo-27232. Let's put this on hold until that is resolved.

    7. berkerpeksag commented on Oct 6, 2016

      @berkerpeksag
      Member

      It looks like the fspath protocol support has already been implemented in b64f83d6ff24.

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

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions