'Parse all remaining data and return the root message object.'

def close(self):

    self._input.close()
    self._call_parse()
    root = self._pop_message()
    assert (not self._msgstack)
    if ((root.get_content_maintype() == 'multipart') and (not root.is_multipart())):
        root.defects.append(errors.MultipartInvariantViolationDefect())
    return root
