Bug report #8355

Opening a nonexistent spatialite database with DB Manager

Added by Rémi Bovard over 11 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:17135

Description

When opening a nonexistent spatialite database with DB Manager, an exception is raised.

It should be handled like in the "Add Spatialite Table" tool with a warning message.


Related issues

Related to QGIS Redmine (QGIS bug tracker) - Support #8331: redmine database out ouf sync with git repository Closed 2013-07-20

History

#1 Updated by Giovanni Manghi over 11 years ago

  • Status changed from Open to Feedback

on QGIS master it gives a message like

"C:/Users/username/test.sqlite" not found

it is not what you get?

#2 Updated by Rémi Bovard over 11 years ago

No, a Python error is raised:

Traceback (most recent call last):
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_model.py", line 402, in rowCount
    self._refreshIndex( parent, True )
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_model.py", line 454, in _refreshIndex
    if item.populate():
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_model.py", line 151, in populate
    if not connection.connect():
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\spatialite\\plugin.py", line 79, in connect
    return self.connectToUri(uri)
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\plugin.py", line 93, in connectToUri
    self.db = self.databasesFactory( self, uri )
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\spatialite\\plugin.py", line 64, in databasesFactory
    return SLDatabase(connection, uri)
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\spatialite\\plugin.py", line 84, in __init__
    Database.__init__(self, connection, uri)
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\plugin.py", line 172, in __init__
    self.connector = self.connectorsFactory( uri )
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\spatialite\\plugin.py", line 87, in connectorsFactory
    return SpatiaLiteDBConnector(uri)
  File "C:/Program Files/QGIS Weekly/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\spatialite\\connector.py", line 40, in __init__
    raise ConnectionError( self.tr('"%s" not found') % self.dbname )
AttributeError: SpatiaLiteDBConnector instance has no attribute 'tr'

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.9.0-Master Master, d37e03b

This happens when I double click on the non existent registered database in DB Manager.

#3 Updated by Jürgen Fischer over 11 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

already fixed in b9ada4c2d

Also available in: Atom PDF