def _scrub_item(self, item, restore=True):
        """Remove tags from an Item's associated file and, if `restore`
        is enabled, write the database's tags back to the file.
        """
        # Get album art if we need to restore it.
        if restore:
            try:
                mf = mediafile.MediaFile(util.syspath(item.path),
                                         config['id3v23'].get(bool))
            except __HOLE__ as exc:
                self._log.error(u'could not open file to scrub: {0}',
                                exc)
            art = mf.art

        # Remove all tags.
        self._scrub(item.path)

        # Restore tags, if enabled.
        if restore:
            self._log.debug(u'writing new tags after scrub')
            item.try_write()
            if art:
                self._log.debug(u'restoring art')
                mf = mediafile.MediaFile(util.syspath(item.path),
                                         config['id3v23'].get(bool))
                mf.art = art
                mf.save()
dataset/ETHPy150Open beetbox/beets/beetsplug/scrub.py/ScrubPlugin._scrub_item