Typo here also.  Catching multiple exceptions must be passed as a tuple like this:

    except (error.CmdError, IOError), detail:
    ...