Python error when trying to change font

Bug #622793 reported by chrelad@gmail.com
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PyRoom
Fix Committed
Undecided
Unassigned

Bug Description

1. I start pyroom with ./pyroom
2. I hit CTL+P to bring up preferences
3. I click the font button
4. I select a different font face
5. I click "OK"
6. I see an error message saying:

Traceback (most recent call last):

  File "/home/chrisd/src/pyroom/PyRoom/preferences.py", line 178, in change_font
    font_type = widget.get_name().split('_')[1]

IndexError: list index out of range

7. In stdout in the terminal, I get the following errors:

/home/chrisd/src/pyroom/PyRoom/cmdline.py:74: PangoWarning: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'
  gtk.main()

8. The "Custom font" radio button is checked now but the font button disabled
9. Clicking any other font option ("Default document", "Default monospace") results in the same error

It appears that checking any of the font options causes the same problem to occur.

Version information:
./pyroom --version
pyroom 0.4.2

I pulled this from the bzr repo at 10:55 AM on Mon, Aug 23rd, 2010.

Related branches

Revision history for this message
chrelad@gmail.com (chrelad) wrote :

I print()'d the widget.get_name() and it appears to be "GtkRadioButton" for the radio buttons as expected. I'm not sure why we are trying to split the widget name on '_' when there are none. I must be missing something.

Revision history for this message
chrelad@gmail.com (chrelad) wrote :

I think I've got this fixed. It appeared to me that there was no name explicitly set on the GTK objects, so that's all I did and everything started working. I'll include a patch for the changed lines in preferences.glade.

Revision history for this message
Adam Rooke (abelianr) wrote :

Thanks for reporting and fixing this. I had briefly looked at it over the weekend. Will push to trunk when my version of bzr is no longer broken.

Adam Rooke (abelianr)
Changed in pyroom:
status: New → Fix Committed
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.