Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad file for binary mode icon #16

Closed
rhl-bthr opened this issue Apr 13, 2018 · 4 comments
Closed

Bad file for binary mode icon #16

rhl-bthr opened this issue Apr 13, 2018 · 4 comments

Comments

@rhl-bthr
Copy link
Contributor

Steps to reproduce:

  • Open the activity

Logs have this:

1523625981.252962 ERROR root: Exception reading icon info: File contains no section headers.
file: /usr/share/icons/gnome/48x48/mimetypes/binary.png, line: 1
'\x89PNG\r\n'
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.
file: /usr/share/icons/gnome/48x48/mimetypes/binary.png, line: 1
'\x89PNG\r\n'
@rhl-bthr
Copy link
Contributor Author

Reproduced on:
Ubuntu 16.04, Sugar 0.112 using Abacus at c0f998e

@quozl
Copy link
Contributor

quozl commented Apr 19, 2018

Does not occur if the gnome-icon-theme package is not installed.

Looks like a problem in the toolkit, caused by a GNOME icon having same first-name as an Abacus icon. There's probably nothing wrong with Abacus using this same icon name.

Perhaps add a check for '.svg' in info.get_filename() before replacing it?

@walterbender
Copy link
Member

We could rename the icon in any case.

quozl added a commit to quozl/sugar-toolkit-gtk3 that referenced this issue May 24, 2018
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 sugarlabs/activity-abacus#16
@quozl
Copy link
Contributor

quozl commented May 24, 2018

As it has no impact in the activity, I don't think it is worth renaming. I've added a toolkit fix.

rhl-bthr pushed a commit to sugarlabs/sugar-toolkit-gtk3 that referenced this issue May 24, 2018
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 sugarlabs/activity-abacus#16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants