https://bugs.freedesktop.org/show_bug.cgi?id=86114
Bug ID: 86114
Summary: Corrupt xlsx after deleting columns
Product: LibreOffice
Version: 4.3.2.2 release
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: major
Priority: medium
Component: Spreadsheet
Assignee: [email protected]
Reporter: [email protected]
Problem description: Xlsx is not saving the spreadsheet correctly somehow.
Python pandas errors when I do the following steps.
Steps to reproduce:
1. create an ods file with several columns
2. save ods file as xslx
3. in the xslx, delete some columns from the end
4. try to import it using df=pd.read_excel (pandas); get error.
Current behavior: If we right click and delete entire columns from the LO gui,
we get the error. If we just hand delete the cells, there is no error.
Error from pandas:
--------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-34-44faaa7b5381> in <module>()
1 file = "a.xlsx"
----> 2 df=pd.read_excel(file, 'a', index_col=0)
/usr/lib/python2.7/dist-packages/pandas/io/excel.pyc in read_excel(io,
sheetname, **kwds)
111 engine = kwds.pop('engine', None)
112
--> 113 return ExcelFile(io, engine=engine).parse(sheetname=sheetname,
**kwds)
114
115
/usr/lib/python2.7/dist-packages/pandas/io/excel.pyc in __init__(self, io,
**kwds)
148 self.book = xlrd.open_workbook(file_contents=data)
149 else:
--> 150 self.book = xlrd.open_workbook(io)
151 elif engine == 'xlrd' and isinstance(io, xlrd.Book):
152 self.book = io
/usr/lib/python2.7/dist-packages/xlrd/__init__.pyc in open_workbook(filename,
logfile, verbosity, use_mmap, file_contents, encoding_override,
formatting_info, on_demand, ragged_rows)
414 formatting_info=formatting_info,
415 on_demand=on_demand,
--> 416 ragged_rows=ragged_rows,
417 )
418 return bk
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in open_workbook_2007_xml(zf,
component_names, logfile, verbosity, use_mmap, formatting_info, on_demand,
ragged_rows)
752 x12sheet = X12Sheet(sheet, logfile, verbosity)
753 heading = "Sheet %r (sheetx=%d) from %r" % (sheet.name, sheetx,
fname)
--> 754 x12sheet.process_stream(zflo, heading)
755 del zflo
756 sheet.tidy_dimensions()
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in own_process_stream(self,
stream, heading)
521 elem.clear() # destroy all child elements (cells)
522 elif elem.tag == U_SSML12 + "dimension":
--> 523 self.do_dimension(elem)
524 self.finish_off()
525
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in do_dimension(self, elem)
529 # print >> self.logfile, "dimension: ref=%r" % ref
530 last_cell_ref = ref.split(':')[-1] # example: "Z99"
--> 531 rowx, colx = cell_name_to_rowx_colx(last_cell_ref)
532 self.sheet._dimnrows = rowx + 1
533 self.sheet._dimncols = colx + 1
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in
cell_name_to_rowx_colx(cell_name, letter_value)
87 else: # start of row number; can't be '0'
88 colx = colx - 1
---> 89 assert 0 <= colx < X12_MAX_COLS
90 break
91 except KeyError:
AssertionError:
Expected behavior: Should be no error.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs