New submission from Isaac Boates <[email protected]>:
I was just using the sqlite3 package and was very confused when trying to open
an sqlite database from a relative path, because the only error provided was:
File "/path/to/filepy", line 50, in __init__
self.connection = sqlite3.connect(path)
sqlite3.OperationalError: unable to open database file
It turns out I was just executing Python from the wrong location and therefore
my relative path was broken. Not a big problem. But it was confusing because it
only throws this generic OperationalError.
Could it instead throw a FileNotFoundError if the db simply doesn't exist at
the specified path?
----------
messages: 402309
nosy: iboates
priority: normal
severity: normal
status: open
title: sqlite3.connect() should check if the sqlite file exists and throw a
FileNotFoundError if it doesn't
versions: Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45255>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com