Skip to content

unexpected behavior of pathlib with empty string #140971

Description

@sarnold

Bug report

Bug description:

While os.path.exists("") correctly returns False, the same input with Path("").exists() returns True.

>>> from pathlib import Path
>>> import os
>>> Path("").exists()
True
>>> os.path.exists("")
False
>>>

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions