diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index e6749c7ba..d6512e369 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -284,9 +284,9 @@ class Account: :returns: :class:`deltachat.contact.Contact` instance. """ (name, addr) = self.get_contact_addr_and_name(obj, name) - name = as_dc_charpointer(name) - addr = as_dc_charpointer(addr) - contact_id = lib.dc_create_contact(self._dc_context, name, addr) + name_c = as_dc_charpointer(name) + addr_c = as_dc_charpointer(addr) + contact_id = lib.dc_create_contact(self._dc_context, name_c, addr_c) return Contact(self, contact_id) def get_contact(self, obj) -> Optional[Contact]: @@ -363,12 +363,12 @@ class Account: :returns: list of :class:`deltachat.contact.Contact` objects. """ flags = 0 - query = as_dc_charpointer(query) + query_c = as_dc_charpointer(query) if only_verified: flags |= const.DC_GCL_VERIFIED_ONLY if with_self: flags |= const.DC_GCL_ADD_SELF - dc_array = ffi.gc(lib.dc_get_contacts(self._dc_context, flags, query), lib.dc_array_unref) + dc_array = ffi.gc(lib.dc_get_contacts(self._dc_context, flags, query_c), lib.dc_array_unref) return list(iter_array(dc_array, lambda x: Contact(self, x))) def get_fresh_messages(self) -> Generator[Message, None, None]: diff --git a/python/src/deltachat/chat.py b/python/src/deltachat/chat.py index 77fac073d..e666b6cd4 100644 --- a/python/src/deltachat/chat.py +++ b/python/src/deltachat/chat.py @@ -162,8 +162,8 @@ class Chat: :param name: as a unicode string. :returns: True on success, False otherwise """ - name = as_dc_charpointer(name) - return bool(lib.dc_set_chat_name(self.account._dc_context, self.id, name)) + name_c = as_dc_charpointer(name) + return bool(lib.dc_set_chat_name(self.account._dc_context, self.id, name_c)) def get_color(self): """return the color of the chat.