1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-30 23:41:52 +03:00

examples: Ensure we write bytes to the self-pipe

Strings in python3 default to unicode, so when writing to
the self-pipe we must be sure to use bytes by calling the
encode() method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2013-12-03 15:47:33 +00:00
parent 3f4e32c6a1
commit b882ae9ecf

View File

@ -236,7 +236,7 @@ class virEventLoopPure:
def interrupt(self):
if self.runningPoll and not self.pendingWakeup:
self.pendingWakeup = True
os.write(self.pipetrick[1], 'c')
os.write(self.pipetrick[1], 'c'.encode("UTF-8"))
# Registers a new file handle 'fd', monitoring for 'events' (libvirt