This means, that you should rewrite your code as:
logging.debug("detect mimetypes faild because %s", e)
According to https://docs.python.org/2/library/logging.html
Logger.debug(msg, *args, **kwargs)
… Logs a message with level DEBUG on this logger. The
msgis the message format string, and theargsare the arguments which are merged into msg using the string formatting operator. (Note that this means that you can use keywords in the format string, together with a single dictionary argument.) …