gwui.py:909:set_overlay_text:AttributeError: 'InputTextView' object has no attribute 'pango_overlay'

Bug #577050 reported by Tom "spot" Callaway
114
This bug affects 57 people
Affects Status Importance Assigned to Milestone
Gwibber
Won't Fix
Medium
Unassigned
gwibber-midgard-backend
New
Undecided
Unassigned

Bug Description

First reported here: https://bugzilla.redhat.com/show_bug.cgi?id=587715

gwibber tracebacked on a user like this:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/gwibber/client.py", line 397, in
on_input_changed
    self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))
  File "/usr/lib/python2.6/site-packages/gwibber/gwui.py", line 909, in
set_overlay_text
    self.pango_overlay.set_markup(self.overlay_text % (self.overlay_color,
text))
AttributeError: 'InputTextView' object has no attribute 'pango_overlay'

Looking at the code, there are three ways that set_overlay_text gets called:

1. as part of gwui.py:expose_view
2. as part of client.py:on_input_changed
3. as part of lib/gtk/widgets.py:on_input_changed

This specific traceback happens as result of codepath #2. When it gets called before expose_view is called, pango_overlay doesn't exist. The solution looks to either be to always call expose_view before on_input_changed, or to simply make sure that pango_overlay is created before we try to use it.

I've attached a patch which does the latter.

Related branches

Revision history for this message
Tom "spot" Callaway (tcallawa) wrote :
Revision history for this message
Natim (site-remy) wrote :

The fix is not right.

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/client.py", line 475, in on_input_changed
    self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))
  File "/usr/lib/python2.6/dist-packages/gwibber/gwui.py", line 958, in set_overlay_text
    if not self.pango_overlay:
AttributeError: 'InputTextView' object has no attribute 'pango_overlay'

Revision history for this message
Natim (site-remy) wrote :
Revision history for this message
Tom "spot" Callaway (tcallawa) wrote :

Yep. Your fix is correct, mine wasn't quite. :)

Omer Akram (om26er)
Changed in gwibber:
importance: Undecided → Medium
milestone: none → 2.91.2
status: New → Confirmed
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This is from the old client, pre-3.2.

Changed in gwibber:
milestone: 2.91.2 → none
status: Confirmed → Won't Fix
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.