Skip to content

support pathlib.Path objects as filepath? #234

@raphaelquast

Description

@raphaelquast

Hey, I've just noticed that the reader can't deal with pathlib.Path objects... (standard python3 - pathlib)

I guess it should be an easy fix (a simple str() for any path-like object already does the trick...)

from pathlib import Path
import shapefile
shppath = Path(".... path to the shapefile")

r = shapefile.Reader(shppath)         # this will fail
r.records()

r = shapefile.Reader(str(shppath))    # works as expected
r.records()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions