camptocamp / QGIS-SpreadSheetLayers

QGIS plugin to load layers from spreadsheet files (*.ods, *.xls, *.xlsx)
GNU General Public License v3.0
21 stars 7 forks source link

importing ods-file leads to phyton runtime error #49

Open ThomasStruller opened 6 months ago

ThomasStruller commented 6 months ago

Opening an ods-file in Qgis 3.34 forced a phyton runtime error:

RuntimeError: Invalid value for number-rows-repeated = 1048565 May be caused by: Invalid value for number-rows-repeated = 1048560 Traceback (most recent call last): File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 324, in on_filePathButton_clicked self.afterOpenFile() File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 329, in afterOpenFile self.openDataSource() File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 362, in openDataSource if self.dataSource and self.dataSource.GetDriver().GetName() in ["XLS"]: File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\ogr.py", line 1287, in len return self.GetLayerCount() File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\ogr.py", line 838, in GetLayerCount return _ogr.DataSource_GetLayerCount(self, *args) RuntimeError: Invalid value for number-rows-repeated = 1048565 May be caused by: Invalid value for number-rows-repeated = 1048560

Python-Version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)] QGIS-Version: 3.34.4-Prizren Prizren, decd43dc

Python-Pfad: C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ThToolBox C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ProcessX C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\postgis_toolbox C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pdaltools C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\munsellrgb C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour C:/OSGeo4W/apps/qgis-ltr/./python C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis-ltr/./python/plugins C:\OSGeo4W\apps\grass\grass83\etc\python C:\Users\thomas.struller\Documents C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools\tools C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages W:/Guggenmuehle

arnaud-morvan commented 6 months ago

Hello @ThomasStruller ,

Thanks for raising this.

Can you provide an example file so I can try to reproduce ?

The error seems to happen in OGR, I suspect that OGR did not managed to read your file, in which case I would not be able to fix it. This plugin is just a dialog to create an OGR VRT file.

If you cannot open your file directly in QGIS using OGR provider, the issue might not be fixable on the SpreadSheetLayers plugin side.

Regards