OperationalError raised when error is different.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
This bug appears when creating a new database with some missing dependency or another error. I can confirm that it happened to me 'cause of the following error with the PIL module:
IOError: decoder jpeg not available
But the real bug happens afterwards.
On the file web_services.py in method _initialize_db there is a occurs that an exception is raised after the cursor is already closed. Said method has a try that encloses a cr.close() statement in three places, line 74, line 93, and line 99. This last one inside the except clause.
If this method reaches line 74 before try catches an exception the cr passes as closed to the exception then the code if cr: raises a different exception itself when trying to use an already closed cursor.
Then the error message is apparently a database issue "OperationalError; Can't use a closed cursor" when the real exception occured before and is not referenced as the issue that stop installation.
I would think that an acceptable solution would be to remove the if cr statement placing instead a try: cr.close() or better yer an if cr._Cursor__closed that would check status of said cursor and return true if is closed avoiding the OperationalError.
Information for replication:
Elementary OS.
Python 2.7.3
Pip 1.1
pillow 2.3.0
openobject-
Changed the line if cr for if not cr._Cursor__closed.