Hacker News new | ask | show | jobs
by benno128 1022 days ago
You just need to create the file first!

    >>> open("data.db", "w+").close()
    >>> db = sqlite3.connect("/data.db")
    >>> db
    <sqlite3.Connection object at 0x8b3fd8>
1 comments

Oh cool!

Regular Python doesn't need me to create the file first, I wonder why this works differently.

Might be this particular build of Python, or might be that I implemented one of the `fd` functions in a way Python/SQlite is surprised by. I'll have a look into it some time!
Maybe just the missing leading slash in the original reproducer? :)