-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
reference_filepath="test.xlsx"
df = pd.read_excel(reference_filepath)
writer = pd.ExcelWriter(reference_filepath)
Issue Description
Note: I can't check that this bug exists on the latest version of panda since it is not supported by my system. However, I have 2.0.3 and don't see this bug fixed in the "bug fix" sections of 2.2 and 2.1.
When opening the same .xlsx file once with read_excel and once with ExcelWriter, the .xlsx file gets corrupted and become impossible to read by any mean.
Expected Behavior
I would expect a lock when one of the functions is being used that prevents the other function from interacting with the file. The surprising bit is that, in my understanding, read_excel closes the file after reading.
Installed Versions
INSTALLED VERSIONS
commit : 0f43794
python : 3.8.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.4.0-19041-Microsoft
Version : #4355-Microsoft Thu Apr 12 17:37:00 PST 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.0.3
numpy : 1.24.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 45.2.0
pip : 24.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.2.0
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None