[systemd-devel] [PATCH] analyze: work around bug in Python 3 Cairo bindings

Shawn Landen shawnlandden at gmail.com
Mon Jul 9 21:16:41 PDT 2012


From: Shawn Landden <shawnlandden at gmail.com>

The python3 version of the Cairo bindings doesn't know how to write
to sys.stdout/sys.stderr, which changed from from accepting str in
python 2, to accepting a byte stream in python 3.

Work around this by using /dev/stdout.

http://bugs.freedesktop.org/show_bug.cgi?id=50989
---
 src/analyze/systemd-analyze |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze
index 76eceee..240d541 100755
--- a/src/analyze/systemd-analyze
+++ b/src/analyze/systemd-analyze
@@ -150,7 +150,7 @@ def plot():
         if width < 1000:
                 width = 1000
 
-        surface = cairo.SVGSurface(sys.stdout, width, height)
+        surface = cairo.SVGSurface("/dev/stdout", width, height)
         context = cairo.Context(surface)
 
         draw_box(context, 0, 0, width, height, 1, 1, 1)
-- 
1.7.10.4



More information about the systemd-devel mailing list