# Buggy code
def commands(self):
    def scrub_func(lib, opts, args):
        # This is a little bit hacky, but we set a global flag to
        # avoid autoscrubbing when we're also explicitly scrubbing.
        global scrubbing
        scrubbing = True

        # Walk through matching files and remove tags.
        for item in lib.items(ui.decargs(args)):
            self._log.info("scrubbing: {0}", util.displayable_path(item.path))

            # Get album art if we need to restore it.
            if opts.write:
                mf = mediafile.MediaFile(item.path, config["id3v23"].get(bool))
                art = mf.art

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

            # Restore tags, if enabled.
            if opts.write:
                self._log.debug("writing new tags after scrub")
                item.try_write()
                if art:
                    self._log.info("restoring art")
                    mf = mediafile.MediaFile(item.path)
                    mf.art = art
                    mf.save()

        scrubbing = False

    scrub_cmd = ui.Subcommand("scrub", help="clean audio tags")
    scrub_cmd.parser.add_option(
        "-W",
        "--nowrite",
        dest="write",
        action="store_false",
        default=True,
        help="leave tags empty",
    )
    scrub_cmd.func = scrub_func

    return [scrub_cmd]


# Traceback (IOError)
scrubbing: C:\Users\100557855\Desktop\Music\Above &amp; Beyond\TriΓÇÉState\01 TriΓÇÉ
State.mp3
Traceback (most recent call last):
File "C:\Python27\Scripts\beet-script.py", line 9, in <module>
load_entry_point('beets==1.3.10', 'console_scripts', 'beet')()
File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 945, in main
_raw_main(args)
File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 935, in _raw_m
ain
subcommand.func(lib, suboptions, subargs)
File "C:\Python27\lib\site-packages\beetsplug\scrub.py", line 73, in scrub_fun
c
config['id3v23'].get(bool))
File "C:\Python27\lib\site-packages\beets\mediafile.py", line 1314, in __init_
_
self.mgfile = mutagen.File(path)
File "C:\Python27\lib\site-packages\mutagen\_file.py", line 221, in File
fileobj = open(filename, "rb")
IOError: [Errno 2] No such file or directory: 'C:\\Users\\100557855\\Desktop\\Mu
sic\\Above &amp; Beyond\\Tri\xe2\x80\x90State\\01 Tri\xe2\x80\x90State.mp3'

# Fixed code
def commands(self):
    def scrub_func(lib, opts, args):
        # This is a little bit hacky, but we set a global flag to
        # avoid autoscrubbing when we're also explicitly scrubbing.
        global scrubbing
        scrubbing = True

        # Walk through matching files and remove tags.
        for item in lib.items(ui.decargs(args)):
            self._log.info("scrubbing: {0}", util.displayable_path(item.path))

            # Get album art if we need to restore it.
            if opts.write:
                try:
                    mf = mediafile.MediaFile(item.path, config["id3v23"].get(bool))
                except IOError as exc:
                    self._log.error("scrubbing failed: {0}", exc)
                art = mf.art

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

            # Restore tags, if enabled.
            if opts.write:
                self._log.debug("writing new tags after scrub")
                item.try_write()
                if art:
                    self._log.info("restoring art")
                    mf = mediafile.MediaFile(item.path)
                    mf.art = art
                    mf.save()

        scrubbing = False

    scrub_cmd = ui.Subcommand("scrub", help="clean audio tags")
    scrub_cmd.parser.add_option(
        "-W",
        "--nowrite",
        dest="write",
        action="store_false",
        default=True,
        help="leave tags empty",
    )
    scrub_cmd.func = scrub_func

    return [scrub_cmd]