mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
bbf396fc5562b4f0e27132f6b10c8a503f71effc
The event callback gets a buffer parameter which is usually something like a log message. However as it comes from C it is not necessarily well-formed (eg) UTF-8 but could contain any old sequence of bytes. In the test case provided by the reporter, we failed to encode the buffer as 'str' with this error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 137: unexpected end of data Use 'bytes' instead. Strictly speaking this changes the type signature of the callbacks, but our existing Python tests which just print the buffer using '%s' don't fail and in any case we don't guarantee the stability of non-C APIs. Reported-by: Yonatan Shtarkman See: https://listman.redhat.com/archives/libguestfs/2023-February/030653.html
Libguestfs is tools and a library for accessing and modifying guest disk images. For more information see the home page: http://libguestfs.org/ For discussion, development, patches, etc. please use the mailing list: http://www.redhat.com/mailman/listinfo/libguestfs To find out how to build libguestfs from source, read: docs/guestfs-building.pod http://libguestfs.org/guestfs-building.1.html man docs/guestfs-building.1 Copyright (C) 2009-2023 Red Hat Inc. The library is distributed under the LGPLv2+. The programs are distributed under the GPLv2+. Please see the files COPYING and COPYING.LIB for full license information. The examples are under a very liberal license.
Description
Languages
C
42.7%
OCaml
35.5%
Shell
7.1%
Makefile
4%
Perl
2.6%
Other
8%