diff --git a/pandas/io/excel.py b/pandas/io/excel.py index 0f9df845117db..5bce37b9d7735 100644 --- a/pandas/io/excel.py +++ b/pandas/io/excel.py @@ -10,6 +10,7 @@ import abc import warnings import numpy as np +from io import UnsupportedOperation from pandas.core.dtypes.common import ( is_integer, is_float, @@ -388,8 +389,13 @@ def __init__(self, io, **kwds): elif not isinstance(io, xlrd.Book) and hasattr(io, "read"): # N.B. xlrd.Book has a read attribute too if hasattr(io, 'seek'): - # GH 19779 - io.seek(0) + try: + # GH 19779 + io.seek(0) + except UnsupportedOperation: + # HTTPResponse does not support seek() + # GH 20434 + pass data = io.read() self.book = xlrd.open_workbook(file_contents=data)