Skip to content

Add Path.lexist() to pathlib #78318

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

Closed
lordmauve mannequin opened this issue Jul 17, 2018 · 6 comments
Closed

Add Path.lexist() to pathlib #78318

lordmauve mannequin opened this issue Jul 17, 2018 · 6 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-pathlib type-feature A feature request or enhancement

Comments

@lordmauve
Copy link
Mannequin

lordmauve mannequin commented Jul 17, 2018

BPO 34137
Nosy @brettcannon, @nphilipp, @lordmauve, @tirkarthi, @e-kayrakli
PRs
  • gh-78318: Add pathlib.Path.lexists and related #21157
  • 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 2018-07-17.10:59:41.899>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Add Path.lexist() to pathlib'
    updated_at = <Date 2020-06-25.15:50:44.247>
    user = 'https://github.com/lordmauve'

    bugs.python.org fields:

    activity = <Date 2020-06-25.15:50:44.247>
    actor = 'nils'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-07-17.10:59:41.899>
    creator = 'lordmauve'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34137
    keywords = ['patch']
    message_count = 5.0
    messages = ['321812', '321820', '321913', '321915', '372378']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'nils', 'lordmauve', 'apatrushev', 'xtreak', 'e-kayrakli']
    pr_nums = ['21157']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34137'
    versions = ['Python 3.7']

    @lordmauve
    Copy link
    Mannequin Author

    lordmauve mannequin commented Jul 17, 2018

    When using pathlib to manipulate paths that may be symlinks or regular files, a pattern that comes up frequently is this expression:

    path.is_symlink() or path.exists()

    os.path.lexists(path) can be used for this, but when using pathlib going back to os.path for this seems like defeat.

    @lordmauve lordmauve mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jul 17, 2018
    @e-kayrakli
    Copy link
    Mannequin

    e-kayrakli mannequin commented Jul 17, 2018

    I haven't contributed to Python yet and I can contribute this as a way for me to practice the PR process in Python.

    As this is a small addition, should I create a PR right away, or wait for a consensus here?

    @brettcannon
    Copy link
    Member

    If you're okay with the PR being rejected because the decision is the method isn't desired, then feel free to go ahead and create a PR, Engin! But if you want to a better chance that it will eventually go in then I would wait for consensus.

    @e-kayrakli
    Copy link
    Mannequin

    e-kayrakli mannequin commented Jul 18, 2018

    Thanks for the response Brett! I am not going to rush, then. But if I happen to have some free time and motivation to create the PR, I will just do it. I don't mind revising or getting rejected.

    @nphilipp
    Copy link
    Mannequin

    nphilipp mannequin commented Jun 25, 2020

    I've come across this issue lately and proposed a PR which implements this and, analogous to os.stat(), adds a follow_symlinks parameter to Path.exists().

    @AlexWaygood
    Copy link
    Member

    Closing as rejected -- see comments on the PR: #21157 (comment)

    @AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-pathlib type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants