Skip to content
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.2.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ including other versions of pandas.

Fixed regressions
~~~~~~~~~~~~~~~~~
- Fixed bug in :meth:``read_excel`` that caused it to fail when checking version of older xlrd versions(:issue:`38955`)
- Fixed regression in :meth:`~DataFrame.to_pickle` failing to create bz2/xz compressed pickle files with ``protocol=5`` (:issue:`39002`)
- Fixed regression in :func:`pandas.testing.assert_series_equal` and :func:`pandas.testing.assert_frame_equal` always raising ``AssertionError`` when comparing extension dtypes (:issue:`39410`)
-
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from pandas._libs.parsers import STR_NA_VALUES
from pandas._typing import Buffer, DtypeArg, FilePathOrBuffer, StorageOptions
from pandas.compat._optional import import_optional_dependency
from pandas.compat._optional import _get_version, import_optional_dependency
from pandas.errors import EmptyDataError
from pandas.util._decorators import Appender, deprecate_nonkeyword_arguments, doc

Expand Down Expand Up @@ -1056,7 +1056,7 @@ def __init__(
else:
import xlrd

xlrd_version = LooseVersion(xlrd.__version__)
xlrd_version = LooseVersion(_get_version(xlrd))

if xlrd_version is not None and isinstance(path_or_buffer, xlrd.Book):
ext = "xls"
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/excel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from pandas.compat._optional import import_optional_dependency
from pandas.compat._optional import _get_version, import_optional_dependency

pytestmark = [
pytest.mark.filterwarnings(
Expand All @@ -29,4 +29,4 @@
else:
import xlrd

xlrd_version = LooseVersion(xlrd.__version__)
xlrd_version = LooseVersion(_get_version(xlrd))