diff --git a/pypureomapi.py b/pypureomapi.py index 825ebc5..3c906a3 100644 --- a/pypureomapi.py +++ b/pypureomapi.py @@ -1214,7 +1214,7 @@ def __lookup(self, ltype, **kwargs): elif _k == "name": msg.obj.append((b"name", kwargs[k].encode('utf-8'))) else: - msg.obj.append((str(k).encode(), kwargs[k].encode('utf-8'))) + msg.obj.append((str(_k).encode(), kwargs[k].encode('utf-8'))) response = self.query_server(msg) if response.opcode != OMAPI_OP_UPDATE: raise OmapiErrorNotFound()