After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667096 - KeyError: 'bibtex-error'
KeyError: 'bibtex-error'
Status: RESOLVED FIXED
Product: gedit-latex
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Pietro Battiston
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-01 17:38 UTC by Sven
Modified: 2019-02-22 03:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
One-liner fix (1.03 KB, patch)
2012-10-18 18:34 UTC, Pietro Battiston
committed Details | Review

Description Sven 2012-01-01 17:38:25 UTC
Traceback (most recent call last):
  • File "/usr/lib/gedit/plugins/latex/util.py", line 165 in decorated_function
    return function(*args, **kw)
  • File "/usr/lib/gedit/plugins/latex/bibtex/editor.py", line 141 in __parse
    self.remove_markers("bibtex-error")
  • File "/usr/lib/gedit/plugins/latex/editor.py", line 494 in remove_markers
    type_record = self._marker_types[marker_type]
KeyError: 'bibtex-error'

I have the latest git version of the latex plugin.
Comment 1 Pietro Battiston 2012-10-18 18:34:45 UTC
Created attachment 226765 [details] [review]
One-liner fix

The bug is confirmed and grave, but that particular traceback is just a consequence of an error which comes out when opening a .bib file (and which is only printed to terminal):

Traceback (most recent call last):
  • File "/usr/lib/gedit/plugins/latex/util.py", line 116 in decorated_function
    return function(*args, **kw)
  • File "/usr/lib/gedit/plugins/latex/bibtex/editor.py", line 142 in __parse
    self.remove_markers("bibtex-error")
  • File "/usr/lib/gedit/plugins/latex/editor.py", line 497 in remove_markers
    type_record = self._marker_types[marker_type]
KeyError: 'bibtex-error'


It is grave because it halts the initialization of the BibTeXEditor instance and hence trigger a series of errors, included the one reported.

Luckily, the fix is trivial, see the attached patch.
Comment 2 Pietro Battiston 2012-10-18 18:36:17 UTC
Sorry, I copypasted the same traceback, that's the right one (the one coming out at startup in the terminal):

Traceback (most recent call last):
  • File "/usr/lib/gedit/plugins/latex/tabdecorator.py", line 87 in _on_load
    self._adjust_editor()
  • File "/usr/lib/gedit/plugins/latex/tabdecorator.py", line 146 in _adjust_editor
    editor_class.__init__(self._editor, self, file)
  • File "/usr/lib/gedit/plugins/latex/bibtex/editor.py", line 62 in __init__
    Editor.__init__(self, tab_decorator, file)
  • File "/usr/lib/gedit/plugins/latex/editor.py", line 105 in __init__
    self._window_context.create_editor_views(self, file)
  • File "/usr/lib/gedit/plugins/latex/windowcontext.py", line 67 in create_editor_views
    self.editor_views[editor][id] = clazz(self, editor)
  • File "/usr/lib/gedit/plugins/latex/bibtex/views.py", line 58 in __init__
    self._item_none = Gtk.RadioMenuItem.new_with_label(None, _("No Grouping"))
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72 in constructor
    return info.invoke(cls, *args, **kwargs)
TypeError: Argument 0 does not allow None as a value

Comment 3 Ignacio Casal Quinteiro (nacho) 2012-10-18 18:40:18 UTC
Review of attachment 226765 [details] [review]:

Looks good to me.
Comment 4 José Aliste 2012-10-18 20:09:03 UTC
Nacho, could you just push the patch? I don't have my ssh keys in this new computer.
Comment 5 José Aliste 2012-10-18 20:09:03 UTC
Nacho, could you just push the patch? I don't have my ssh keys in this new computer.
Comment 6 Ignacio Casal Quinteiro (nacho) 2012-10-19 06:15:26 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.