Trying to remove a local persistent utility using unregisterUtility results in errors like "AttributeError: type object 'IFavoriteStorage' has no attribute '__iro__' ". And above all: no one seems to know how to fix it "properly". Comments are more then welcome!
There are two parts to the solution: there is the definition of the utility and the utility itself.
1. Unregister the utility (remove defition):
portal.getSiteManager().unregisterUtility(utility, IFavoriteStorage)
2. Delete the object (remove utility itself):
del my_utility
So add or edit Extensions/Install.py and add something like this:
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import log
from zope.component import getUtility
from fourdigits.favorites.interfaces import IFavoriteStorage
import transaction
def uninstall(portal, reinstall=False):
# Remove utilities when really uninstalled
if not reinstall:
my_utility = getUtility(IMyFirstUtility)
portal.getSiteManager().unregisterUtility(my_utility, IFavoriteStorage)
del my_utility
transaction.commit()
log("Uninstalled fourdigits.favorites")
return "Ran all uninstall steps."




zope.component
http://svn.zope.org/[…]/adapter.py?rev=101362&r1=99411&r2=101362
This was released in 3.5.2. If you could try using that version and confirm it is fixed, it would be nice !