Menu

#17 Problem opening XLSX file

Release 4.4
closed
None
2014-05-16
2014-05-16
RHarris
No

testing functionality by using demo/app.py
INFO:main:Mode: process
ERROR:root:Can't convert 'NoneType' object to str implicitly
File "app.py", line 415, in <module>
with stingray.workbook.open_workbook( input ) as source:
/stingray/workbook/init.py", line 330, in call
return XLSX_Workbook( name, file_object )
/stingray/workbook/xlsx.py", line 60, in init
self._prepare()
/stingray/workbook/xlsx.py", line 70, in _prepare
self._get_shared_strings()
e/stingray/workbook/xlsx.py", line 127, in _get_shared_strings
self.strings_dict[ count ]+= element.text
TypeError: Can't convert 'NoneType' object to str implicitly</module>

Discussion

  • Steven F. Lott

    Steven F. Lott - 2014-05-16

    The demo/app.py isn't really designed to work with the .xlsx files. It doesn't use the sheet name to pick specific sheets.

    python3 demo/app.py -d -l 1 sample/\*.csv
    

    This will show how the application works. It's focused on .CSV files where there are no sheets in the file.

     
  • Steven F. Lott

    Steven F. Lott - 2014-05-16
    • status: open --> closed
    • assigned_to: Steven F. Lott
     
  • Steven F. Lott

    Steven F. Lott - 2014-05-16

    This is a lack of clarity in the documentation. The demo/app.py doesn't work with .XLSX files as written.

     
  • RHarris

    RHarris - 2014-05-16

    This isn't an issue that is specific with the demo app. I simply attempted to use the demo app when it was failing for me at the same point. Converting the file to an XLS file and the code works where the XLSX file fails, using the code:
    with stingray.workbook.open_workbook( args.datadictionary ) as data_dictionary:
    dd_sheet= data_dictionary.sheet( 'Data Dictionary v8.9',
    stingray.sheet.EmbeddedSchemaSheet,
    loader_class= stingray.schema.loader.HeadingRowSchemaLoader )

     

Log in to post a comment.