Ticket #87 (new defect)
tutorial error when creating database (mac/pysqlite2)
|Reported by:||guest||Owned by:|
I get an exception running the main elixir tutorial code when it first tries to write to the database.
At the very first call to create_all, I get a "ProgrammingError: (ProgrammingError) Cannot operate on a closed cursor. None None"
A smoking gun stack trace pointing here: /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/SQLAlchemy-0.4.6.0001-py2.5.egg/sqlalchemy/databases/sqlite.pyc in has_table(self, connection, table_name, schema)
291 # consume remaining rows, to work around 292 # http://www.sqlite.org/cvstrac/tktview?tn=1884
--> 293 while cursor.fetchone() is not None:
294 pass 295
At this poitn the sqlite database file has been created, but it has size 0. I get the same error if I try a memory sqlite database instead of a file one.
If I comment out lines 293 and 294 of SQLAlchemy-0.4.6.0001-py2.5.egg/sqlalchemy/databases/sqlite.py reload, it all works well.
I'm posting here rather than SQLAlchemy, because the SQL Alchemy tutorial actually worked well for me verbatim! http://www.rmunn.com/sqlalchemy-tutorial/tutorial.html It makes me wonder whether it is an elixir thing? Or in any event, it makes it difficult to get through the tutorial for people with my setup, whatever elements it are that cause the problem.
Suggestions are welcome... I'd rather not run with a patched library unless necessary.
Thanks! Excited I found a way to make it work so I can keep using Elixir, it looks great.
elixir version 0.6.1 sqlalchemy version 0.4.6 python version 2.5.2 ipython and python it breaks in both pysqlite2 installed Mac OS X 10.4
Let me know if I can provide any more detail?
Heather hpiwowar at gmail