support pathlib.Path objects as filepath?
raphaelquast opened this issue · 2 comments
raphaelquast commented
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()karimbahgat commented
Thanks for putting this on the radar. Support for pathlib and other path-like objects will be included in next version, see #233.
raphaelquast commented
awesome! nice to hear :-)