search for: guestfs_int_py_fromstrings

Displaying 20 results from an estimated 20 matches for "guestfs_int_py_fromstrings".

2017 May 09
1
[PATCH v2] python: add simple wrappers for PyObject<->string functions
...args) extern char **guestfs_int_py_get_string_list (PyObject *obj); extern PyObject *guestfs_int_py_put_string_list (char * const * const argv); extern PyObject *guestfs_int_py_put_table (char * const * const argv); +extern PyObject *guestfs_int_py_fromstring (const char *str); +extern PyObject *guestfs_int_py_fromstringsize (const char *str, size_t size); +extern char *guestfs_int_py_asstring (PyObject *obj); "; @@ -178,31 +181,16 @@ and generate_python_structs () = function | name, FString -> pr " PyDict_SetItemString (dict, \"%s\",\n" name; -...
2020 Apr 26
5
[PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...an-1-0-32bit libpoppler-glib4 libpoppler5 libsensors3 libtelepathy-glib0 m4 opensc opensc-32bit permissions pinentry poppler-tools python-gtksourceview splashy syslog-ng tar tightvnc xorg-x11 xorg-x11-xauth yast2-mouse Fix this by globally changing guestfs_int_py_fromstring() and guestfs_int_py_fromstringsize() to fallback to latin1 decoding if utf-8 decoding fails. Using the "strict" error handler doesn't matter in the case of latin1 and has the same effect of "replace": https://docs.python.org/3/library/codecs.html#error-handlers Signed-off-by: Sam Eiderman <sameid@go...
2020 Apr 20
4
[PATCH v2] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...an-1-0-32bit libpoppler-glib4 libpoppler5 libsensors3 libtelepathy-glib0 m4 opensc opensc-32bit permissions pinentry poppler-tools python-gtksourceview splashy syslog-ng tar tightvnc xorg-x11 xorg-x11-xauth yast2-mouse Fix this by globally changing guestfs_int_py_fromstring() and guestfs_int_py_fromstringsize() to decode utf-8 with the "replace" error handler: https://docs.python.org/3/library/codecs.html#error-handlers For example, this will decode PackageKit's description on SLES4 the following way: Backend: pisi S.�a&#287;lar Onur <caglar@pardus.org.tr> Sig...
2017 May 09
0
[PATCH] python: add simple wrappers for PyObject<->string functions
...args) extern char **guestfs_int_py_get_string_list (PyObject *obj); extern PyObject *guestfs_int_py_put_string_list (char * const * const argv); extern PyObject *guestfs_int_py_put_table (char * const * const argv); +extern PyObject *guestfs_int_py_fromstring (const char *str); +extern PyObject *guestfs_int_py_fromstringsize (const char *str, size_t size); +extern char *guestfs_int_py_asstring (PyObject *obj); "; @@ -178,31 +181,16 @@ and generate_python_structs () = function | name, FString -> pr " PyDict_SetItemString (dict, \"%s\",\n" name; -...
2020 Apr 20
2
[PATCH] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
The python3 bindings create unicode objects from application strings on the guest (i.e. installed rpm, deb packages). It is documented that rpm package fields such as description should be utf8 encoded - however in some cases they are not a valid unicode string, on SLES11 SP4 the following packages fail to be converted to unicode using guestfs_int_py_fromstring() (which invokes
2017 May 09
1
[PATCH] RHBZ#1406906: check return value of Python object functions
...; + pr " goto err;\n"; + pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; | name, FBuffer -> - pr " PyDict_SetItemString (dict, \"%s\",\n" name; - pr " guestfs_int_py_fromstringsize (%s->%s, %s->%s_len));\n" - typ name typ name + pr " value = guestfs_int_py_fromstringsize (%s->%s, %s->%s_len);\n" + typ name typ name; + pr " if (value == NULL)\n"; + pr " goto err;\n&quot...
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...; + pr " goto err;\n"; + pr " PyDict_SetItemString (dict, \"%s\", value);\n" name; | name, FBuffer -> - pr " PyDict_SetItemString (dict, \"%s\",\n" name; - pr " guestfs_int_py_fromstringsize (%s->%s, %s->%s_len));\n" - typ name typ name + pr " value = guestfs_int_py_fromstringsize (%s->%s, %s->%s_len);\n" + typ name typ name; + pr " if (value == NULL)\n"; + pr " goto err;\n&quot...
2020 Jun 03
2
Re: [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...nentry > > poppler-tools > > python-gtksourceview > > splashy > > syslog-ng > > tar > > tightvnc > > xorg-x11 > > xorg-x11-xauth > > yast2-mouse > > > > Fix this by globally changing guestfs_int_py_fromstring() > > and guestfs_int_py_fromstringsize() to fallback to latin1 decoding if > > utf-8 decoding fails. > > > > Using the "strict" error handler doesn't matter in the case of latin1 > > and has the same effect of "replace": > > > > https://docs.python.org/3/library/codecs.html...
2020 Jun 30
3
Re: [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...--- a/python/handle.c > > +++ b/python/handle.c > > @@ -387,7 +387,7 @@ guestfs_int_py_fromstring (const char *str) > > #if PY_MAJOR_VERSION < 3 > > return PyString_FromString (str); > > #else > > - return PyUnicode_FromString (str); > > + return guestfs_int_py_fromstringsize (str, strlen (str)); > > #endif > > } > > > > @@ -397,7 +397,12 @@ guestfs_int_py_fromstringsize (const char *str, > size_t size) > > #if PY_MAJOR_VERSION < 3 > > return PyString_FromStringAndSize (str, size); > > #else > > - return P...
2020 Apr 20
0
[PATCH] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
The python3 bindings create unicode objects from application strings on the guest (i.e. installed rpm, deb packages). It is documented that rpm package fields such as description should be utf8 encoded - however in some cases they are not a valid unicode string, on SLES11 SP4 the following packages fail to be converted to unicode using guestfs_int_py_fromstring() (which invokes
2020 Apr 20
0
Re: [PATCH] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
On Mon, Apr 20, 2020 at 01:17:35PM +0300, Sam Eiderman wrote: > The python3 bindings create unicode objects from application strings > on the guest (i.e. installed rpm, deb packages). > It is documented that rpm package fields such as description should be > utf8 encoded - however in some cases they are not a valid unicode > string, on SLES11 SP4 the following packages fail to be
2020 Apr 20
0
Re: [PATCH v2] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...> opensc > opensc-32bit > permissions > pinentry > poppler-tools > python-gtksourceview > splashy > syslog-ng > tar > tightvnc > xorg-x11 > xorg-x11-xauth > yast2-mouse > > Fix this by globally changing guestfs_int_py_fromstring() > and guestfs_int_py_fromstringsize() to decode utf-8 with the "replace" > error handler: > > https://docs.python.org/3/library/codecs.html#error-handlers > > For example, this will decode PackageKit's description on SLES4 the > following way: > > Backend: pisi > S.�a&#2...
2020 Apr 23
0
Re: [PATCH v2] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...4 > opensc > opensc-32bit > permissions > pinentry > poppler-tools > python-gtksourceview > splashy > syslog-ng > tar > tightvnc > xorg-x11 > xorg-x11-xauth > yast2-mouse > > Fix this by globally changing guestfs_int_py_fromstring() > and guestfs_int_py_fromstringsize() to decode utf-8 with the "replace" > error handler: > > https://docs.python.org/3/library/codecs.html#error-handlers > > For example, this will decode PackageKit's description on SLES4 the > following way: > > Backend: pisi > S.�a&#287;...
2020 May 13
0
Re: [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...> opensc > opensc-32bit > permissions > pinentry > poppler-tools > python-gtksourceview > splashy > syslog-ng > tar > tightvnc > xorg-x11 > xorg-x11-xauth > yast2-mouse > > Fix this by globally changing guestfs_int_py_fromstring() > and guestfs_int_py_fromstringsize() to fallback to latin1 decoding if > utf-8 decoding fails. > > Using the "strict" error handler doesn't matter in the case of latin1 > and has the same effect of "replace": > > https://docs.python.org/3/library/codecs.html#error-handlers > > S...
2020 Jun 30
0
Re: [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...gtksourceview > > > splashy > > > syslog-ng > > > tar > > > tightvnc > > > xorg-x11 > > > xorg-x11-xauth > > > yast2-mouse > > > > > > Fix this by globally changing guestfs_int_py_fromstring() > > > and guestfs_int_py_fromstringsize() to fallback to latin1 decoding if > > > utf-8 decoding fails. > > > > > > Using the "strict" error handler doesn't matter in the case of latin1 > > > and has the same effect of "replace": > > > > > > https://docs.py...
2020 Apr 25
1
Re: [PATCH v2] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...nentry > > poppler-tools > > python-gtksourceview > > splashy > > syslog-ng > > tar > > tightvnc > > xorg-x11 > > xorg-x11-xauth > > yast2-mouse > > > > Fix this by globally changing guestfs_int_py_fromstring() > > and guestfs_int_py_fromstringsize() to decode utf-8 with the "replace" > > error handler: > > > > https://docs.python.org/3/library/codecs.html#error-handlers > > > > For example, this will decode PackageKit's description on SLES4 the > > following way: > > > > B...
2020 Jun 30
0
Re: [PATCH v3] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)
...ex 2fb8c18f0..fe89dc58a 100644 > --- a/python/handle.c > +++ b/python/handle.c > @@ -387,7 +387,7 @@ guestfs_int_py_fromstring (const char *str) > #if PY_MAJOR_VERSION < 3 > return PyString_FromString (str); > #else > - return PyUnicode_FromString (str); > + return guestfs_int_py_fromstringsize (str, strlen (str)); > #endif > } > > @@ -397,7 +397,12 @@ guestfs_int_py_fromstringsize (const char *str, size_t size) > #if PY_MAJOR_VERSION < 3 > return PyString_FromStringAndSize (str, size); > #else > - return PyUnicode_FromStringAndSize (str, size); &gt...
2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...+399,8 @@ guestfs_int_py_fromstring (const char *str) #ifdef HAVE_PYSTRING_ASSTRING return PyString_FromString (str); #else - return PyUnicode_FromString (str); + Py_ssize_t size = strlen(str); + return PyUnicode_DecodeUTF8 (str, size, decode_error_handler); #endif } @@ -396,7 +410,7 @@ guestfs_int_py_fromstringsize (const char *str, size_t size) #ifdef HAVE_PYSTRING_ASSTRING return PyString_FromStringAndSize (str, size); #else - return PyUnicode_FromStringAndSize (str, size); + return PyUnicode_DecodeUTF8 (str, size, decode_error_handler); #endif } diff --git a/python/t/test830RHBZ1406906.py b/py...
2017 May 21
3
[PATCH 0/2] python: improved UTF8 decoding error handling
The Python 3 bindings currently are unable to deal with non UTF8 characters. This series continues what proposed in RHBZ#1406906. A new function 'set_decode_error_handler' allows the User to specify how to deal with decoding errors. The default behaviour will be raising a UnicodeDecodeError. If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped in a
2020 Jan 09
9
[PATCH 0/7] Various Python cleanups.
...thon < 3 support is not dropped yet, however it will be easier after this series. Pino Toscano (7): build: enforce a minimum Python version python: drop code for Python < 2.5 python: assume support for Capsules python: remove compile time check for PyString_AsString python: replace guestfs_int_py_fromstringsize in Py2 branches python: stop including config.h python: stop bundling config.h in dist archives .gitignore | 1 - generator/python.ml | 32 ++------------------------------ m4/guestfs-python.m4 | 21 +++++---------------- python/MANIFEST.in | 1 - python/Makefile.am | 5 -...