sqlite3.OperationalError: unable to open database file

Bug #1052146 reported by Filip Chabik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UberWriter (moved to github!)
Fix Committed
High
Unassigned

Bug Description

I'm not an programmer myself, although for me it looks like there's somewhere in the code location of the file locales.db hardcoded:

hadret@r2-d2 ~ % uberwriter
Traceback (most recent call last):
  File "/usr/bin/uberwriter", line 43, in <module>
    import uberwriter
  File "/usr/lib/python2.7/dist-packages/uberwriter/__init__.py", line 25, in <module>
    from uberwriter import UberwriterWindow
  File "/usr/lib/python2.7/dist-packages/uberwriter/UberwriterWindow.py", line 49, in <module>
    from uberwriter_lib.thirdparty.gtkspellcheck import SpellChecker
  File "/usr/lib/python2.7/dist-packages/uberwriter_lib/thirdparty/gtkspellcheck/__init__.py", line 57, in <module>
    from .spellcheck import SpellChecker
  File "/usr/lib/python2.7/dist-packages/uberwriter_lib/thirdparty/gtkspellcheck/spellcheck.py", line 32, in <module>
    from ..pylocales import code_to_name
  File "/usr/lib/python2.7/dist-packages/uberwriter_lib/thirdparty/pylocales/__init__.py", line 55, in <module>
    from locales import *
  File "/usr/lib/python2.7/dist-packages/uberwriter_lib/thirdparty/pylocales/locales.py", line 54, in <module>
    _database = sqlite3.connect(os.path.join(__path__, 'locales.db'))
sqlite3.OperationalError: unable to open database file

I built UberWriter with "default" paths, so it's using /usr/bin /usr/lib etc. If there's anything else I can provide to help track this bug down, please let me know.

Regards,
Hadret

Revision history for this message
Wolf Vollprecht (w-vollprecht) wrote :

Hi,

so I guess you are *not* running ubuntu, right?

Because I will target other platforms as soon as possible (I had multiple requests to do so).

Actually, I was asked specifically by the ubuntu app team to install the app into /opt/extras.ubuntu.com/uberwriter/

Will fix soon.

Stay tuned,

Wolf

Revision history for this message
Wolf Vollprecht (w-vollprecht) wrote :

Ah, well of course it would be very nice to hear which distro you're using and how you installed the app :)

Changed in uberwriter:
importance: Undecided → High
status: New → Won't Fix
status: Won't Fix → Confirmed
Revision history for this message
Filip Chabik (hadret) wrote :

I'm using Debian, so it's close enough to Ubuntu. I built Debian package using pure dh_python2 (no extra flags, no extra options). It seems, that locales.db (under pylocales) is not included by default -- I found workaround for this, but at the moment it's pretty "hackish" and I'm still searching for cleaner solution. Either way, the issue is more likely due to the installation method and not the application itself, so I guess it can be closed. Unless there's some way to forcefully include locales.db during the installation on applications side? Cause this is the only file, that's not going where it suppose to go...

Revision history for this message
Wolf Vollprecht (w-vollprecht) wrote :

Hi Filip,

the method I was using in the beginning was also quite "hackish":

You can add these lines in debian/rules at "override_dh_install:"

 cp -r uberwriter_lib/thirdparty/gtkspellcheck/locale/ debian/uberwriter/opt/extras.ubuntu.com/uberwriter/uberwriter_lib/thirdparty/gtkspellcheck/locale/
 cp -r uberwriter_lib/thirdparty/pylocale/databases/ debian/uberwriter/opt/extras.ubuntu.com/uberwriter/uberwriter_lib/thirdparty/pylocale/databases/
 cp -r uberwriter_lib/thirdparty/pylocale/locales/ debian/uberwriter/opt/extras.ubuntu.com/uberwriter/uberwriter_lib/thirdparty/pylocale/locales/
 cp uberwriter_lib/thirdparty/pylocale/locales.db debian/uberwriter/opt/extras.ubuntu.com/uberwriter/uberwriter_lib/thirdparty/pylocale/locales.db

and modify them to your need / install dir.

Revision history for this message
Wolf Vollprecht (w-vollprecht) wrote :

Oh, I guess the foldernames where the files come from might have changed (e.g. «thirdparty» dir is not there anymore, would be cool if you check that before using :)

Changed in uberwriter:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.