diff --git a/qubes/api/__init__.py b/qubes/api/__init__.py index 38532913..f35974ec 100644 --- a/qubes/api/__init__.py +++ b/qubes/api/__init__.py @@ -323,7 +323,7 @@ class QubesDaemonProtocol(asyncio.Protocol): self.send_header(0x31) if subject is not self.app: - self.transport.write(subject.name.encode('ascii')) + self.transport.write(str(subject).encode('ascii')) self.transport.write(b'\0') self.transport.write(event.encode('ascii') + b'\0') diff --git a/qubes/tests/api.py b/qubes/tests/api.py index b24ab80e..ba74a208 100644 --- a/qubes/tests/api.py +++ b/qubes/tests/api.py @@ -77,7 +77,11 @@ class TestMgmt(object): class Subject: name = 'subject' - self.send_event(Subject, 'event', payload=untrusted_payload.decode()) + + def __str__(self): + return 'subject' + + self.send_event(Subject(), 'event', payload=untrusted_payload.decode()) try: # give some time to close the other end yield from asyncio.sleep(0.1)