raf
unread,Jan 27, 2020, 7:24:07 PM1/27/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python...@googlegroups.com
hi,
i've just come to the conclusion that openpyxl, when
just reading an xlsx file, leaves it open when the
reading is complete. i found this out because a
subsequent attempt to rename the file on windows fails
(because some process has the file is open). when i
added an explicit workbook.close() method after
reading, the problem went away.
i'm using openpyxl-2.6.4 with python-2.7 and i assume
that the bug won't be fixed there but i didn't notice
any mention of it in the changelog for later, python-3
only versions of openpyxl, which may or may not exhibit
the same problem.
so, any openpyxl developers listening, you might want
to determine if this is a real bug in the latest
version and, if so, fix it. if this behaviour is
happening but isn't considered to be a bug, then please
improve the simple reading examples in the
documentation by including code to close the file after
reading so the behaviour doesn't surprise anyone else.
cheers,
raf