Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the fspath protocol in the posixpath module #71418

Closed
JelleZijlstra opened this issue Jun 5, 2016 · 5 comments
Closed

Support the fspath protocol in the posixpath module #71418

JelleZijlstra opened this issue Jun 5, 2016 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@JelleZijlstra
Copy link
Member

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']

    @JelleZijlstra
    Copy link
    Member Author

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

    @JelleZijlstra JelleZijlstra self-assigned this Jun 5, 2016
    @JelleZijlstra JelleZijlstra added the stdlib Python modules in the Lib dir label Jun 5, 2016
    @JelleZijlstra
    Copy link
    Member Author

    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.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jun 6, 2016

    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.

    @JelleZijlstra
    Copy link
    Member Author

    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.

    @berkerpeksag
    Copy link
    Member

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

    @berkerpeksag berkerpeksag added the type-feature A feature request or enhancement label Oct 6, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants