[Libguestfs] [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)

Richard W.M. Jones rjones at redhat.com
Mon Jul 6 11:39:13 UTC 2020


Hi Sam,

I was doing some work on the Python bindings, starting with removing
support for Python 2 since it's EOL.  I thought I would have a look at
this patch.

So firstly I think the last version posted is:

  https://www.redhat.com/archives/libguestfs/2020-April/msg00190.html

My impression of this is that we shouldn't just hack the Python
bindings to make this apparently work.  But I wanted to ask you a few
questions about this:

 - Does the SUSE RPM output contain a mix of encodings?  Or is
   it all latin-1 or utf-8?

 - Is there any indication of the correct encoding from RPM?

 - Can we not instead escape the bad sequences using whatever is the
   C-level equivalent of str.encode(..., 'backslashreplace')?
   Or I guess better, escape them as Unicode compatibility characters
   https://en.wikipedia.org/wiki/Unicode_compatibility_characters

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list