Platform: Firefox 3.6.13, Python 2.7 stackless, and Windows 7 (not yet tested on Ubuntu, I will...)
I tried with the apsw library:
conn = apsw.C
Firefox uses SQLite to obtain an EXCLUSIVE lock on the database, which is why you cannot open it: http://www.sqlite.org/pragma.html#pragma_locking_mode
I am not sure about the lock type Firefox uses, but I'd recommend this:
Copy the Firefox database file to a different temporary location and read it from there (this also lowers the risk of accidentally damaging the original file).
I haven't had problems with this method yet on Firefox 3.*.