Skip to content

Commit 892dd3d

Browse files
WillAydharisbal
authored and
harisbal
committed
ASV: Added seek to buffer to fix xlwt asv failure (pandas-dev#19926)
* Added seek to buffer to fix xlwt asv failure * Added conditional to check for seek on xlrd object
1 parent 2d10b35 commit 892dd3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/io/excel.py

+4
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ def __init__(self, io, **kwds):
387387
self.book = io
388388
elif not isinstance(io, xlrd.Book) and hasattr(io, "read"):
389389
# N.B. xlrd.Book has a read attribute too
390+
if hasattr(io, 'seek'):
391+
# GH 19779
392+
io.seek(0)
393+
390394
data = io.read()
391395
self.book = xlrd.open_workbook(file_contents=data)
392396
elif isinstance(self._io, compat.string_types):

0 commit comments

Comments
 (0)