No file copying, and no Windows import override needed #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't create unnecessary copies of sqlite3 files
This takes up time and disk space unnecessarily.
SQLite3 is able to open databases in a read-only, lock-free mode (see
"nolock" in https://www.sqlite.org/c3ref/open.html). Tested on Linux with
Chrome, Chromium, and Firefox; loading cookies from databases opened in this
mode appear to work fine.
Somewhat frustratingly and confusingly, this option seems only to be
accessible by using 'file:' URIs, and not via any other API (see
https://www.codejam.info/2021/10/bypass-sqlite-exclusive-lock.html).
Fortunately, the standard library module pathlib (Python 3.4+) makes it easy
to convert paths to 'file:' URIs in a cross-platform way.
Remove ancient import override for Windows
The replacement of sqlite3 with pysqlite2 on Windows dates back to the
initial 2015 commit to the parent repository
(richardpenman/browsercookie@7828992).
pysqlite2 is no longer maintained, and there no longer appears to be any bug
or limitation preventing sqlite3 from opening Chrome/Firefox databases on
Windows.