Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#51624 - [python-gtkspellcheck] OperationalError: unable to open database file

Attached to Project: Community Packages
Opened by Sergio de la Cruz (sergiodlc) - Tuesday, 01 November 2016, 01:25 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 02 November 2016, 11:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When importing gtkspellcheck in python I get an OperationalError exception coming from SQLite. The exception seems related to the file permissions for /usr/lib/python3.5/site-packages/pylocales/locales.db, a file owned by this package.

Additional info:
* package version(s): 4.0.5-1

The exception traceback:

In [1]: from gtkspellcheck import SpellChecker
---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
<ipython-input-1-814239506a0a> in <module>()
----> 1 from gtkspellcheck import SpellChecker

/usr/lib/python3.5/site-packages/gtkspellcheck/__init__.py in <module>()
50 '__desc_long__' : __desc_long__}
51
---> 52 from gtkspellcheck.spellcheck import (SpellChecker, NoDictionariesFound,
53 NoGtkBindingFound)

/usr/lib/python3.5/site-packages/gtkspellcheck/spellcheck.py in <module>()
30 import sys
31
---> 32 from pylocales import code_to_name as _code_to_name
33 from pylocales import LanguageNotFound, CountryNotFound
34

/usr/lib/python3.5/site-packages/pylocales/__init__.py in <module>()
46 '__desc_long__' : __desc_long__}
47
---> 48 from pylocales.locales import (Country, Language, LanguageNotFound,
49 CountryNotFound, code_to_name)

/usr/lib/python3.5/site-packages/pylocales/locales.py in <module>()
61
62 # loading the database
---> 63 _database = sqlite3.connect(os.path.join(__path__, 'locales.db'))
64
65 logger = logging.getLogger(__name__)

OperationalError: unable to open database file



Steps to reproduce:

1. Open a python interpreter as a non root user
2. Try importing from gtkspellcheck: from gtkspellcheck import SpellChecker


How to fix:

The problem seems related to the permissions for the file /usr/lib/python3.5/site-packages/pylocales/locales.db. It's set to 600 (read only by root). Setting it to 644 fixed the exception for me.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Wednesday, 02 November 2016, 11:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-gtkspellcheck 4.0.5-2

Loading...