Bug 521591

Summary: ibus: check if the icon filename is a real file before trying to open it
Product: [Fedora] Fedora Reporter: Harshula Jayasuriya <harshula>
Component: ibusAssignee: Peng Huang <phuang>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 11CC: i18n-bugs, petersen, phuang
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-15 06:19:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Check if the icon member variable is an empty string and whether it maps to a real file. none

Description Harshula Jayasuriya 2009-09-07 07:31:21 UTC
Description of problem:
* In ui/gtk/engineabout.py, the existing code assumes self.__engine_desc.icon contains a valid path to the icon file. However, some engines may not have an icon file, hence the variable can be empty. We need to check the variable before using it.

Version-Release number of selected component (if applicable):
* ibus-1.1.0.20090612-3.fc11.x86_64

How reproducible:
* Always

Steps to Reproduce:
1. Run ibus-setup
2. Click on the "Input Methods" tab and select an input method without its own icon
3. Press the "About" button
  
Actual results:
------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hjayasur/ibus-root/share/ibus/setup/main.py", line 201, in __button_engine_about_cb
    about = EngineAbout(engine)
  File "/home/hjayasur/ibus-root/share/ibus/setup/engineabout.py", line 36, in __init__
    self.__init_ui()
  File "/home/hjayasur/ibus-root/share/ibus/setup/engineabout.py", line 50, in __init_ui
    self.__fill_text_view()
  File "/home/hjayasur/ibus-root/share/ibus/setup/engineabout.py", line 59, in __fill_text_view
    text_buffer.insert_pixbuf(iter, self.__load_icon(self.__engine_desc.icon))
  File "/home/hjayasur/ibus-root/share/ibus/setup/engineabout.py", line 92, in __load_icon
    pixbuf = gdk.pixbuf_new_from_file(icon)
glib.GError: Failed to open file '': No such file or directory
------------------------------------------------------------

Expected results:
* Display the "About" window

Comment 1 Harshula Jayasuriya 2009-09-07 07:33:11 UTC
Created attachment 359957 [details]
Check if the icon member variable is an empty string and whether it maps to a real file.

Comment 2 Peng Huang 2009-09-09 06:53:45 UTC
This problem has been fixed in upstream. I will build it for rawhide soon.

Comment 3 Peng Huang 2009-09-15 06:19:42 UTC
Fixed in ibus-1_2_0_20090915-1_fc12