When trying to read an excel file that is locked, an exception is raised, but there is no information in the exception that tells you why the file could not be opened:
# tested on Windows
from msvcrt import LK_RLCK, locking
from pathlib import Path
from fastexcel import read_excel
file = Path("file.xlsx")
with file.open("rb") as f:
locking(f.fileno(), LK_RLCK, file.stat().st_size)
read_excel("file.xlsx")
Error message:
_fastexcel.CalamineError: calamine error: Xlsx error: Zip error: i/o error
Context:
0: Could not open workbook at file.xlsx
1: could not load excel file at file.xlsx