def _append_defects(self, part, part_content_type):
part_defects = {}<EOL>for e in part.defects:<EOL><INDENT>defects = "<STR_LIT>".format(e.__class__.__name__, e.__doc__)<EOL>self._defects_categories.add(e.__class__.__name__)<EOL>part_defects.setdefault(part_content_type, []).append(defects)<EOL>log.debug("<STR_LIT>".format(defects))<EOL><DEDENT>if part_defects:<EOL><INDENT>self._has_defects = True<EOL>self._defects.append(part_defects)<EOL><DEDENT>
Add new defects and defects categories to object attributes.

The defects are a list of all the problems found
when parsing this message.

Args:
    part (string): mail part
    part_content_type (string): content type of part