GIScience / orstools-qgis-plugin

Plugin for QGIS with a set of tools to use openrouteservice API´s, based on openstreetmap
https://plugins.qgis.org/plugins/ORStools/
MIT License
92 stars 31 forks source link

TypeError: 'QVariant' object is not subscriptable #75

Closed arthuragone closed 5 years ago

arthuragone commented 5 years ago

Fresh QGIS 3.4.1 windows 10 install, tried to install OSMtools plugin and got this error:

Impossible de charger l'extension 'OSMtools' provoque une erreur lors de l'appel à sa méthode classFactory() 

TypeError: 'QVariant' object is not subscriptable 
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/AVIGNACQ/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\OSMtools\__init__.py", line 36, in classFactory
    return OSMtools(iface)
  File "C:/Users/AVIGNACQ/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\OSMtools\osm_tools.py", line 62, in __init__
    locale = QSettings().value('locale/userLocale')[0:2]
TypeError: 'QVariant' object is not subscriptable

Version de Python : 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
Version de QGIS : 3.4.1-Madeira Madeira, 383851c597 

Chemin Python :
C:/OSGEO4~1/apps/qgis/./python
C:/Users/AVIGNACQ/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/AVIGNACQ/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGEO4~1/apps/qgis/./python/plugins
C:\OSGeo4W64\bin\python37.zip
C:\OSGEO4~1\apps\Python37\DLLs
C:\OSGEO4~1\apps\Python37\lib
C:\OSGeo4W64\bin
C:\OSGEO4~1\apps\Python37
C:\OSGEO4~1\apps\Python37\lib\site-packages
C:\OSGEO4~1\apps\Python37\lib\site-packages\win32
C:\OSGEO4~1\apps\Python37\lib\site-packages\win32\lib
C:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin
C:/Users/AVIGNACQ/AppData/Roaming/QGIS/QGIS3\profiles\default/python
nilsnolde commented 5 years ago

Hi,

I can't reproduce on Ubuntu with QGIS 3.4. Reinstalling OSMTools works fine for me. Did you try on another machine?

Did you install from the plugin repo or Github?

nilsnolde commented 5 years ago

Closing for now. Pls re-open if the issue pertains.

arthuragone commented 5 years ago

For some more informations, it only worked changing language to english rather than local language (french in my case).

nilsnolde commented 5 years ago

Can you try the new version pls? It was approved this morning and should be available through the plugin store.

I did throw out the locale lines. Hope that fixes it. That's mostly needed for translations, which I'm not planning to offer in any case.