[systemd-devel] [PATCH] analyze: Python 3 compatibility

shawn shawnlandden at gmail.com
Mon Jul 9 20:49:35 PDT 2012


On Mon, 2012-07-09 at 23:40 -0400, Dave Reisner wrote: 
> On Thu, Jun 14, 2012 at 03:08:19PM -0700, Shawn Landden wrote:
> > Plot verb doesn't currently work b/c Cairo bug sending to stdout in python 3.
> > ---
> 
> After this patch, plot still doesn't seem to work with py3k, throwing a rather
> useless backtrace:

Correct, and I made note of this in the patch I wrote.[1] The problem is
that 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.

At the time I wrote the patch, I reported this upstream [2], which has
been unresponsive.


[1] "Plot verb doesn't currently work b/c Cairo bug sending to stdout in
python 3."
[2] https://bugs.freedesktop.org/show_bug.cgi?id=50989 
> 
> Traceback (most recent call last):
>   File "/usr/bin/systemd-analyze", line 309, in <module>
>     verb.get(args[0], unknown_verb)()
>   File "/usr/bin/systemd-analyze", line 277, in plot
>     surface.finish()
> TypeError: must be str, not bytes

-- 
-Shawn Landden



More information about the systemd-devel mailing list