code: def openattachment(self, attachid):
          
          attachments = self.get_attachments(None, attachid)
          data = attachments["attachments"][str(attachid)]
          xmlrpcbinary = data["data"]
  
          ret = BytesIO()
          ret.write(xmlrpcbinary.data)
          ret.name = data["file_name"]
          ret.seek(0)
          return ret
docs: Get the contents of the attachment with the given attachment ID.
          Returns a file-like object.