SQLITE engine doesn't work with sqlite version 2.8.17
Running the following code:
import sqlalchemy
database = sqlalchemy.create_engine('sqlite://publish.db')
Results in this traceback:
Traceback (most recent call last):
File "test.py", line 3, in ?
database = sqlalchemy.create_engine('sqlite://publish.db')
File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/__init__.py", line 91, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/strategies.py", line 41, in create
dialect = module.dialect(**dialect_args)
File "/usr/lib/python2.4/site-packages/sqlalchemy/databases/sqlite.py", line 148, in __init__
self.supports_cast = (sqlite is not None and vers(sqlite.sqlite_version) >= vers("3.2.3"))
AttributeError: 'module' object has no attribute 'sqlite_version'
In the Python interpreter I can see that the sqlite module has the "version" attribute but not a "sqlite_version" attribute.
Comments (6)
-
Account Deleted -
Account Deleted - changed status to resolved
(original author: ants) Fixed in 74dfa23a63707b43693125f4b93d099df7f88372.
-
Account Deleted - removed status
- changed status to open
I think you have made a mistake. That revision does not fix this issue.
-
repo owner - changed status to wontfix
sqlite2 is not supported by SQLAlchemy.
-
Account Deleted - removed status
- changed status to open
I appreciate that sqlite2 is not supported by SQLAlchemy. I am not asking you to support it.
I am suggesting that you provide a more helpful error message to the user when things don't work.
I tried to get SQLAlchemy working using Debian packages so you can be sure I am not the only one who has experienced this problem.
-
repo owner - changed status to resolved
changeset:3099 removes the old import of 'sqlite'. so now you'll get:
ImportError: No module named pysqlite2
which is how all the db's react when their expected module is not found.
- Log in to comment
It turns out I was using pysqlite 1.0.1 which doesn't have this attribute.
Would it be possible to update SA to check for the legacy attribute "version" and warn that a newer version of the library is needed?