[Sqlalchemy-tickets] Issue #3172: misleading error message in case of missing permissions to the pa
Brought to you by:
zzzeek
|
From: Tomas M. <iss...@bi...> - 2014-08-25 10:34:28
|
New issue 3172: misleading error message in case of missing permissions to the parent directory (sqlite engine) https://bitbucket.org/zzzeek/sqlalchemy/issue/3172/misleading-error-message-in-case-of Tomas Machalek: In a special case (described below) when trying to update a sqlite3 database file located in a directory I have no write permissions to, I obtain quite a misleading error message: *unable to open database file "insert into ......."* I.e. it looks like Sqlalchemy thinks the SQL is in fact a path to the database. ### How to replicate ### (tested on Linux OS) Manually (i.e. not using a Python code) create a sqlite3 database, e.g. **/home/you/data/test.db** with some table in it: ``` #!sql CREATE TABLE cache (key text primary key, value text); ``` Remove your write permissions from the **data** directory (i.e. not the file itself!). Run the following code: ``` #!python from sqlalchemy import create_engine en = create_engine('sqlite:////home/you/data/test.db') en.execute("INSERT INTO cache (key, value) VALUES ('foo', 'bar')") ``` |