sugarlabs / sugar-toolkit-gtk3

Sugar Learning Environment, Activity Toolkit, GTK 3.
GNU Lesser General Public License v2.1
21 stars 80 forks source link

Fix traceback when an icon name matches a GNOME theme icon #393

Closed quozl closed 6 years ago

quozl commented 6 years ago

When an icon file name matches a GNOME theme icon;

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/sugar3/graphics/icon.py", line 214, in _get_attach_points
    cp.readfp(config_file)
  File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.

Caused by reading a .png file as if it were config file, in turn because the icon was expected by the toolkit to be .svg file type.

Regression introduced by f796638.

Fixes https://github.com/sugarlabs/activity-abacus/issues/16

rhl-bthr commented 6 years ago

Thank you. Tested on Ubuntu 16.04, Sugar 0.112 and Gtk 3.18.9