AndyStricker / FastXLSX

Line-by-line event based memory saving XLSX reader
3 stars 0 forks source link

Error in `cellType(*d)` #2

Closed fulldecent closed 9 years ago

fulldecent commented 9 years ago
in FastXLSX/ on master 
› python xlsx-to-csv.py ~/Desktop/pub.xlsx 'Part 1'         
Loading workbook in progress...
    - create CSV converter
    - open input file /Users/williamentriken/Desktop/pub.xlsx ...
    - shared strings...  Loaded 1494635 shared strings
    - Workbook contains sheets: [u'Part 1', u'Part 2']
    - select work sheet Part 1
['Citation Number', 'Filed Date', 'Issue Date', 'Violation Code', 'Violation Title', 'Location', 'Agency', 'Defendant Last Name', 'Defendant First Name', 'Def City', 'Def State', 'Def Zip', 'DOB', 'Sex', 'Amount Due', 'Amount Paid', 'Closing Disposition', 'Dispo Date', 'Judge/Admin', 'Owner Last Name', 'Owner First Name', 'Owner City', 'Owner State', 'Owner Zip', 'Hearing Date', 'Hearing Time']
Traceback (most recent call last):
  File "xlsx-to-csv.py", line 50, in <module>
    sheet = doc.sheet(sheetname)
  File "/Users/williamentriken/Desktop/FastXLSX/fastxlsx/reader.py", line 420, in sheet
    self.__sheets[name] = Sheet(self, self.archive(), sheet_id)
  File "/Users/williamentriken/Desktop/FastXLSX/fastxlsx/reader.py", line 258, in __init__
    parser.ParseFile(fh)
  File "/Users/williamentriken/Desktop/FastXLSX/fastxlsx/reader.py", line 333, in _end_element
    c[self.VALUE] = cellType(*d)
TypeError: function takes at most 3 arguments (6 given)
AndyStricker commented 9 years ago

Well looks like the code is failing on date column. May I ask you to insert the line

print 'XXX: celltype:', repr(cellType), repr(d)

before the line 333 (c[self.VALUE] = cellType(*d)) and run it again. I wonder what cellType and d contains.

fulldecent commented 9 years ago

Yes, this gave me:

XXX: celltype: <type 'datetime.date'> (2007, 4, 26, 0, 0, 0)