copy_worksheet stopped working in 2.5.4

Issue #1060 duplicate
Oli Warner
created an issue

We have a report that clones a worksheet several times, adds data and then deleted the original. Just updated the server and it has started chucking out a nasty error on the first attempt to copy. Here's the relevant bit of the trace, starting with our code.

File "./bookings/reports.py" in process_data
  709.             ws = self.wb.copy_worksheet(self.initial)

File "/home/dave/Env/ap/lib/python3.6/site-packages/openpyxl/workbook/workbook.py" in copy_worksheet
  394.         cp.copy_worksheet()

File "/home/dave/Env/ap/lib/python3.6/site-packages/openpyxl/worksheet/copier.py" in copy_worksheet
  43.         self.target.merged_cells = copy(self.source.merged_cells)

File "/home/dave/Env/ap/lib/python3.6/copy.py" in copy
  88.         return copier(x)

File "/home/dave/Env/ap/lib/python3.6/site-packages/openpyxl/worksheet/cell_range.py" in __copy__
  456.             n.ranges.append(copy(r))

File "/home/dave/Env/ap/lib/python3.6/copy.py" in copy
  88.         return copier(x)

File "/home/dave/Env/ap/lib/python3.6/site-packages/openpyxl/worksheet/cell_range.py" in __copy__
  136.                               title=self.title)

Exception Value: __init__() got an unexpected keyword argument 'min_col'

I haven't had a chance to bisect commits and dig into this properly but I did step through the releases. 2.5.3 works fine. I have noticed some changes in documentation but something else has happened here.

Unfortunately, I cannot include the spreadsheet.

Comments (2)

  1. Log in to comment