From caab826e8ad56f04b8e94e8776eac08733f666e2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Jul 2016 07:06:53 +0200 Subject: [PATCH] Use repr() for IPC logging messages --- qutebrowser/misc/ipc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 6de2efdf4..4f77379d0 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -299,7 +299,7 @@ class IPCServer(QObject): try: decoded = data.decode('utf-8') except UnicodeDecodeError: - log.ipc.error("invalid utf-8: {}".format(binascii.hexlify(data))) + log.ipc.error("invalid utf-8: {!r}".format(binascii.hexlify(data))) self._handle_invalid_data() return @@ -354,7 +354,7 @@ class IPCServer(QObject): while self._socket is not None and self._socket.canReadLine(): data = bytes(self._socket.readLine()) self.got_raw.emit(data) - log.ipc.debug("Read from socket 0x{:x}: {}".format( + log.ipc.debug("Read from socket 0x{:x}: {!r}".format( id(self._socket), data)) self._handle_data(data) self._timer.start() @@ -482,7 +482,7 @@ def send_to_running_instance(socketname, command, target_arg, *, json_data['cwd'] = cwd line = json.dumps(json_data) + '\n' data = line.encode('utf-8') - log.ipc.debug("Writing: {}".format(data)) + log.ipc.debug("Writing: {!r}".format(data)) socket.writeData(data) socket.waitForBytesWritten(WRITE_TIMEOUT) if socket.error() != QLocalSocket.UnknownSocketError: