Skip to content

Use os.fspath(path_obj) instead of str(path_obj) #1123

Open
@gdementen

Description

@gdementen

When one needs to convert a path-like argument to a string. For built-in Path objects, I think that's equivalent, but it is the recommended approach (mostly to support any object implementing fspath instead of just the builtin Path objects).

https://docs.python.org/3/library/os.html#os.fspath

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions