This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: I cannot use absolute path in sqlite3 , python 2.7.9, windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: jingtao chen, paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-11-29 17:02 by jingtao chen, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg255581 - (view) Author: jingtao chen (jingtao chen) Date: 2015-11-29 17:02
I tried the way like here https://www.sqlite.org/c3ref/open.html#urifilenamesinsqlite3open but it is useless 

what I got is 

C:\Users\CJT-6220>python D:\NKUSearch\pr_cal\main.py
Traceback (most recent call last):
  File "D:\NKUSearch\pr_cal\main.py", line 7, in <module>
    conn = sqlite3.Connection('file:///D:/NKU.db')
sqlite3.OperationalError: unable to open database file


and I tried some other ways to write the URI but none of them works and PEP 249 did not mention anything about absolute path . So what can I do ?
msg255591 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-11-29 20:16
Did you try just using the absolute file path without the file://?  That should work.  I don't believe uri interpretation is enabled by default, according to the docs you linked to.
msg255603 - (view) Author: jingtao chen (jingtao chen) Date: 2015-11-29 23:41
wow...It works...
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69949
2015-11-30 03:54:08eryksunsetresolution: not a bug
stage: resolved
2015-11-29 23:41:03jingtao chensetstatus: open -> closed

messages: + msg255603
2015-11-29 20:16:41r.david.murraysetnosy: + r.david.murray
messages: + msg255591
2015-11-29 17:02:23jingtao chencreate