diff --git a/qubesusbproxy/core3ext.py b/qubesusbproxy/core3ext.py index 799bff6..8ab6e5c 100644 --- a/qubesusbproxy/core3ext.py +++ b/qubesusbproxy/core3ext.py @@ -641,8 +641,11 @@ async def on_device_attach_usb(self, vm, event, device, options): "qubes-usb-proxy not installed in the VM") else: # TODO: sanitize and include stdout + sanitized_stderr = e.stderr.replace("\n", ", ") + if sanitized_stderr.endswith(", "): + sanitized_stderr = santizied_stderr[:-2] + "." sanitized_stderr = ''.join( - [chr(c) for c in e.stderr if 0x20 <= c < 0x80]) + [chr(c) for c in sanitized_stderr if 0x20 <= c < 0x80]) raise QubesUSBException( 'Device attach failed: {}'.format(sanitized_stderr)) finally: