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

Bug #1821683 reported by Xu Zhen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
folder-color (Ubuntu)
Confirmed
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

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in folder-color (Ubuntu):
status: New → Confirmed
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.