Can not change folder color due to failure of os.utime()

Bug #1821683 reported by Xu Zhen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
folder-color (Ubuntu)
Undecided
Unassigned

Bug Description

I tried to set folder color for /etc, but the icon was not changed and I got this error:

Traceback (most recent call last):
  File "/usr/share/caja-python/extensions/folder-color.py", line 316, in _menu_activate_color
    item_path = urllib.unquote(each_item.get_uri()[7:])
  File "/usr/share/caja-python/extensions/folder-color.py", line 96, in set_color
    self.restore_color(item_path)
  File "/usr/share/caja-python/extensions/folder-color.py", line 141, in restore_color
    self._refresh(item_path)
  File "/usr/share/caja-python/extensions/folder-color.py", line 145, in _refresh
    os.utime(item_path, None)
OSError: [Errno 13] Permission denied: '/etc'

Both nautilus and caja extensions have the same issue.

I changed the os.utime line to the following code as a workaround.

try:
  os.utime(item_path, None)
except OSError:
  pass

I just need to press F5 to refresh manually

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers