Closed
Description
The documentation for pandas.read_csv(...)
states that it can support anything that adheres to the os.PathLike
protocol, but the definition of FilePathOrBuffer
is too strict.
Line 138 in 08e4baf
where Path
is a pathlib.Path
object.
Could this be changed to use os.PathLike[str]
or just os.PathLike
?
from os import PathLike
FilePathOrBuffer = Union["PathLike[str]", FileOrBuffer]
PathLike
is in quotes because PathLike
only supports __class_getitem__
for Python 3.9 and later and PathLike
alone might be too broad, assuming you don't want to support byte-encoded paths.
Thanks!