FS#37280 - [gramps] 2:4.0.1-5 unexpected error (python 3.3 ?)

Attached to Project: Community Packages
Opened by Panhaleux Michel (Mithrandir91) - Thursday, 10 October 2013, 08:03 GMT
Last edited by Balló György (City-busz) - Monday, 20 January 2014, 15:54 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Since -5 version of the package, there is an error when I use certain features of the software.
For example when I click on the "preferences" menu and when I request a report Ancestor.

Preference menu
15013: ERROR: grampsapp.py: line 114: Unhandled exception
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/gramps/gui/viewmanager.py", line 1122, in preferences_activate
GrampsPreferences(self.uistate, self.dbstate)
File "/usr/lib/python3.3/site-packages/gramps/gui/configure.py", line 498, in __init__
on_close=update_constants)
File "/usr/lib/python3.3/site-packages/gramps/gui/configure.py", line 189, in __init__
self.__setup_pages(configure_page_funcs)
File "/usr/lib/python3.3/site-packages/gramps/gui/configure.py", line 203, in __setup_pages
labeltitle, widget = func(self)
File "/usr/lib/python3.3/site-packages/gramps/gui/configure.py", line 1255, in add_behavior_panel
current_line, self.path_entry, self.dbstate.db.get_mediapath(),
File "/usr/lib/python3.3/site-packages/gramps/gen/db/read.py", line 1781, in get_mediapath
return self.metadata.get(b'mediapath', None)
File "/usr/lib/python3.3/site-packages/bsddb3/dbshelve.py", line 251, in get
return pickle.loads(data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128)

And when I request a report Ancestor :
35024: ERROR: _reportdialog.py: line 736: Failed to run report.
Traceback (most recent call last):
File "/usr/lib/python3.3/site-packages/gramps/gui/plug/report/_reportdialog.py", line 702, in report
MyReport.write_report()
File "/usr/lib/python3.3/site-packages/gramps/plugins/drawreport/ancestortree.py", line 792, in write_report
self.canvas.paginate(colsperpage, one_page)
File "/usr/lib/python3.3/site-packages/gramps/plugins/lib/libtreebase.py", line 564, in paginate
self.__paginate(colsperpage)
File "/usr/lib/python3.3/site-packages/gramps/plugins/lib/libtreebase.py", line 546, in __paginate
self.__paginate_title(x_page_offsets)
File "/usr/lib/python3.3/site-packages/gramps/plugins/lib/libtreebase.py", line 492, in __paginate_title
self.__pages[self.__pages.keys()[0]].add_box(self.title)
TypeError: 'dict_keys' object does not support indexing
This task depends upon

Closed by  Balló György (City-busz)
Monday, 20 January 2014, 15:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  gramps 2:4.0.2-2
Comment by Sergej Pupykin (sergej) - Thursday, 10 October 2013, 11:31 GMT
This errors don't look as python3 related. Moreover Reports -> Graphical Reports -> Ancestor Tree don't crash gramps on simple database with 2 persons.
Comment by Jan de Groot (JGC) - Thursday, 10 October 2013, 12:03 GMT
This is python related. Strings can either be ascii or binary in python3. If an ascii string contains unicode characters, python will give this backtrace and abort.
Comment by Sergej Pupykin (sergej) - Thursday, 10 October 2013, 12:42 GMT
Maybe exporting db from python2 gramps version and importing it into current will help?
Comment by Panhaleux Michel (Mithrandir91) - Thursday, 10 October 2013, 13:42 GMT
Reloading a previous backup, the error on the preference menu no longer occurs, but the error on the "tree of ancestors" graphical report persist.
Comment by Jan de Groot (JGC) - Thursday, 10 October 2013, 13:58 GMT
Looking at the first trace, gramps stores the data as serialized objects. If that format changes between python versions (where python2 stores everything as binary where python3 has ascii, unicode and binary), then you'll get the error from the first trace.

The 2nd trace left is fixed upstream:
http://sourceforge.net/p/gramps/code/22868/tree//branches/maintenance/gramps40/gramps/plugins/lib/libtreebase.py?diff=5074d46abfc09e08ccc81d4d:22867
Comment by Balló György (City-busz) - Saturday, 18 January 2014, 18:27 GMT
Could you still reproduce the problem with gramps 2:4.0.2-2?
Comment by Panhaleux Michel (Mithrandir91) - Monday, 20 January 2014, 15:46 GMT
I'm sorry but I did not keep the environment producing the problem.
I corrected the problem with the "tree of ancestors" by applying the patch indicated by Jan de Groot above.
Comment by Balló György (City-busz) - Monday, 20 January 2014, 15:54 GMT
The version 4.0.2 contains that patch, so I'm closing this task.

Loading...