From 1e5d9cf3a96c97507fc129e3c3050d121516456a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20S=C3=A9chet?= Date: Wed, 16 Mar 2022 15:50:55 +0100 Subject: [PATCH] build: filter dbus bug assert to avoid log bloat (#60807) --- src/inkscape_wrapper.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/inkscape_wrapper.py b/src/inkscape_wrapper.py index ee326c0d..7ed308a0 100755 --- a/src/inkscape_wrapper.py +++ b/src/inkscape_wrapper.py @@ -1,6 +1,7 @@ #! /usr/bin/env python3 # inkscape wrapper to support command-line parameters for <1.0 and 1.0 -# versions. +# versions, and filter output to avoid log spamming with dbus error +# (https://gitlab.com/inkscape/inkscape/-/issues/294) import subprocess import sys @@ -14,4 +15,17 @@ if b'Inkscape 0' not in inkscape_version: x.replace('--export-png', '--export-filename') for x in args if x not in ('--without-gui', '--file') ] -sys.exit(subprocess.call(['inkscape'] + args)) +inkscape = subprocess.Popen( + ['inkscape'] + args, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + universal_newlines=True +) + +for line in inkscape.stdout: + if "dbus_g_connection_register_g_object: assertion 'connection != NULL' failed" in line: + continue + + sys.stdout.write(line) + +sys.exit(inkscape.returncode) -- 2.35.1