deleting a bible causes a traceback

Bug #1748719 reported by Simon Hanna on 2018-02-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Starting with no OpenLP config, when I import a couple of bibles during the FTW, and then delete a bible from the Library in the main interface I get a traceback.

This happens in trunk

Related branches

Simon Hanna (thelinuxguy) wrote :

Hmm.. the bibles are a little messed up...

the init of a BibleDB object takes the following kwargs:

* path (path to the bible database file)
* name (name of the database, also used as file name for sqlite databases)
* file (no doc)

path and file are supposed to by Path objects, while the name is a string.

It looks like during the migrations to the Paths, this was altered but not to something useful.

especially the path and file look suspicious.

The cause of the actual bug is that the _setup method doesn't set self.file which the delete method depends on.

It would be really helpful if all class attributes where defined in the beginning of a class, so it's clear what the class supports and what not. They don't have to be initialized there, but it should be easy to see what attributes are available without looking through all methods in the class searching for self.* to know what attributes are there.

Simon Hanna (thelinuxguy) wrote :

so it looks like the path contains the directory where the bibles are stored and file contains a pathobject consisting on only a name, the name of the bible db.

I didn't find uses of name. so I guess that can be removed.

Another weird thing about the BibleDB object is that it has a get_name method that overwrites the name of the bible and then returns it. I guess that's sort of valid, because I didn't find any occurrence of a BibleDB object being created with a name, but it still looks weird...

Phill (phill-ridout) on 2019-03-16
Changed in openlp:
assignee: nobody → Phill (phill-ridout)
importance: Undecided → Medium
status: New → In Progress
Phill (phill-ridout) on 2019-03-17
Changed in openlp:
status: In Progress → Fix Committed
Tim Bentley (trb143) on 2019-03-17
Changed in openlp:
milestone: none → 2.9.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers