Skip to content

Commit 8437b30

Browse files
Rename parameter path_or_io to path_or_buffer
1 parent 8e74e5f commit 8437b30

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/io/excel/_base.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ class ExcelFile:
799799
800800
Parameters
801801
----------
802-
path_or_io : str, path object (pathlib.Path or py._path.local.LocalPath),
803-
a file-like object, xlrd workbook or openpypl workbook.
802+
path_or_buffer : str, path object (pathlib.Path or py._path.local.LocalPath),
803+
a file-like object, xlrd workbook or openpypl workbook.
804804
If a string or path object, expected to be a path to a
805805
.xls, .xlsx, .xlsb, .xlsm, .odf, .ods, or .odt file.
806806
engine : str, default None
@@ -826,14 +826,14 @@ class ExcelFile:
826826
"pyxlsb": _PyxlsbReader,
827827
}
828828

829-
def __init__(self, path_or_io, engine=None):
829+
def __init__(self, path_or_buffer, engine=None):
830830
if engine is None:
831831
engine = "xlrd"
832-
if isinstance(path_or_io, IOBase):
833-
if _is_ods_stream(path_or_io):
832+
if isinstance(path_or_buffer, IOBase):
833+
if _is_ods_stream(path_or_buffer):
834834
engine = "odf"
835835
else:
836-
ext = os.path.splitext(str(path_or_io))[-1]
836+
ext = os.path.splitext(str(path_or_buffer))[-1]
837837
if ext == ".ods":
838838
engine = "odf"
839839
if engine not in self._engines:
@@ -842,9 +842,9 @@ def __init__(self, path_or_io, engine=None):
842842
self.engine = engine
843843

844844
# Could be a str, ExcelFile, Book, etc.
845-
self.io = path_or_io
845+
self.io = path_or_buffer
846846
# Always a string
847-
self._io = stringify_path(path_or_io)
847+
self._io = stringify_path(path_or_buffer)
848848

849849
self._reader = self._engines[engine](self._io)
850850

0 commit comments

Comments
 (0)