Displaying 20 results from an estimated 30 matches for "pystring_asstr".
2014 Nov 04
1
Re: [PATCH 7/9] python: fix detection of libpython features
...CHECK_LIB([c],[PyCapsule_New],
> [AC_DEFINE([HAVE_PYCAPSULE_NEW],1,
> [Found PyCapsule_New in libpython.])],
> - [],[$PYTHON_BLDLIBRARY])
> + [],[$PYTHON_LIBS])
> AC_CHECK_LIB([c],[PyString_AsString],
> [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
> [Found PyString_AsString in libpython.])],
> - [],[$PYTHON_BLDLIBRARY])
> -
> - LIBS="$old_LIBS"
> + [],[$PYTHON_LIBS])
&...
2020 Jan 09
9
[PATCH 0/7] Various Python cleanups.
...s/2020-January/msg00035.html
No, Python < 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/M...
2011 Dec 10
1
[PATCH] Fixed checks for libpython features
...else
- LIBPYTHON="python$PYTHON_VERSION"
- fi
- AC_CHECK_LIB([$LIBPYTHON], [PyList_Size], [],
- [AC_MSG_FAILURE([$LIBPYTHON is not installed])])
- AC_CHECK_FUNCS([PyCapsule_New \
- PyString_AsString])
+ PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"`
+ AC_CHECK_LIB([c],[PyCapsule_New],
+ [AC_DEFINE([HAVE_PYCAPSULE...
2017 May 09
1
[PATCH v2] python: add simple wrappers for PyObject<->string functions
..._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;
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyString_FromString (%s->%s));\n"
- typ name;
- pr "#else\n";
- pr " PyUnicode_FromString (%s->%s));\n"
- typ name;
- pr "#...
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
....sysconfig.get_config_var('BLDLIBRARY'))"`
- AC_CHECK_LIB([c],[PyString_FromString],
- [AC_DEFINE([HAVE_PYSTRING_FROMSTRING],1,
- [Found PyString_FromString in libpython.])],
- [],[$PYTHON_BLDLIBRARY])
- AC_CHECK_LIB([c],[PyString_AsString],
- [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
- [Found PyString_AsString in libpython.])],
- [],[$PYTHON_BLDLIBRARY])
- AC_CHECK_LIB([c],[PyUnicode_AsUTF8],
- [AC_DEFINE([HAVE_PYUNICODE_ASUTF8],1,
-...
2014 Aug 08
2
[PATCH 1/2] Add type checking, support integers as value
...@@ -345,10 +345,6 @@ AS_IF([test "x$enable_python" != "xno"],
[AC_DEFINE([HAVE_PYCAPSULE_NEW],1,
[Found PyCapsule_New in libpython])],
[],[$PYTHON_BLDLIBRARY])
- AC_CHECK_LIB([c],[PyString_AsString],
- [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
- [Found PyString_AsString in libpython])],
- [],[$PYTHON_BLDLIBRARY])
LIBS="$old_LIBS"
fi
diff --git a/generator/generator.ml b/generat...
2018 Apr 05
0
[PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.
...;x$PYTHON" != "xno" && test "x$enable_python" != "xno"],[
[AC_DEFINE([HAVE_PYSTRING_FROMSTRING],1,
[Found PyString_FromString in libpython.])],
[],[$PYTHON_BLDLIBRARY])
+ AC_CHECK_LIB([c],[PyString_AsString],
+ [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
+ [Found PyString_AsString in libpython.])],
+ [],[$PYTHON_BLDLIBRARY])
+ AC_CHECK_LIB([c],[PyUnicode_AsUTF8],
+ [AC_DEFINE([HAVE_PYUNICODE_ASUTF8],1,
+...
2018 Jan 29
0
Re: python 3 bindings on libguestfs
...ing for PYTHON... no
> checking Python prefix... /opt/python/x86_64/3.1.1
> checking for Python site-packages path... /opt/python/x86_64/3.1.1/lib/python3.1/site-packages
> checking for Python extension suffix (PEP-3149)... .so
> checking for PyCapsule_New in -lc... no
> checking for PyString_AsString in -lc... no
are generated by this code:
https://github.com/libguestfs/libguestfs/blob/7021a234aa1496ca552ec82ff73747a302a1b80b/m4/guestfs-python.m4#L28
As you can see from the output above you are missing all of the Python
development libraries (eg. ‘python3-devel’ on Fedora).
On my machine...
2012 Aug 25
1
[PATCH] python: Fixed syntax errors in python/guestfs-py.c
..., 1 insertion(+), 1 deletion(-)
diff --git a/generator/generator_python.ml b/generator/generator_python.ml
index dc9cbca..b11df6e 100644
--- a/generator/generator_python.ml
+++ b/generator/generator_python.ml
@@ -391,7 +391,7 @@ free_strings (char **argv)
pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n;
pr "#else\n";
pr " PyObject *bytes;\n";
- pr " bytes = PyUnicode_AsUTF8String (py_%s));\n" n;
+ pr " bytes = PyUnicode_AsUTF8String (py_%s);\n" n;
pr &quo...
2014 Nov 04
0
[PATCH 7/9] python: fix detection of libpython features
...39;))"`
AC_CHECK_LIB([c],[PyCapsule_New],
[AC_DEFINE([HAVE_PYCAPSULE_NEW],1,
[Found PyCapsule_New in libpython.])],
- [],[$PYTHON_BLDLIBRARY])
+ [],[$PYTHON_LIBS])
AC_CHECK_LIB([c],[PyString_AsString],
[AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
[Found PyString_AsString in libpython.])],
- [],[$PYTHON_BLDLIBRARY])
-
- LIBS="$old_LIBS"
+ [],[$PYTHON_LIBS])
fi
AC_SUBST(PYTHON_...
2019 Sep 11
3
[PATCH nbdkit] python: Drop support for Python 2.
This patch proposes to drop support for Python 2 in nbdkit.
Rather than abruptly drop it everywhere, my proposal is that we point
people to nbdkit 1.14 (the current stable version) if they want to
continue with Python 2 plugins, while gently reminding them of the
upcoming Python 2.7 end of life announcement.
Libnbd never supported Python 2. Libguestfs in theory supports
Python 2 but I dropped
2018 Apr 05
4
[PATCH nbdkit] python: Turn python exceptions into nbdkit errors
Much more annoying that it needs to be, but I have tested it and it
works on Python 2 & 3. Note this will not work on Python 3.0 - 3.2,
but I guess we don't care about those versions.
Rich.
2017 May 09
0
[PATCH] python: add simple wrappers for PyObject<->string functions
..._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;
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyString_FromString (%s->%s));\n"
- typ name;
- pr "#else\n";
- pr " PyUnicode_FromString (%s->%s));\n"
- typ name;
- pr "#...
2014 Aug 04
6
[hivex] Segfault for an integer value to node_set_value
Hi,
When an integer argument is passed as value, node_set_value
segfaults. Reproducer is at the end of this message
The backtrace points at hivex-py.c, function get_value. While obj
is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL.
Kind regards,
Peter
https://lekensteyn.nl
#!/usr/bin/env python3
import hivex, sys
h = hivex.Hivex(sys.argv[1])
print(h)
val = {
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi,
This patch series is based on a prior patch[1], splitting off changes as
requested and incorporating feedback from Richard Jones. It introduces type
validation to avoid segmentation faults (instead, it reports an exception) and
fixes handling of the bytes type in Python 3.
Major changes since that series:
- Drop newly introduced support for integer types for DWORD/QWORDS
- Reject Unicode
2018 Jan 30
0
Re: python 3 bindings on libguestfs
The interesting line is this one ...
checking for PyString_AsString in -lc... no
and if you compare that to the code, eg in python/guestfs-py.c:
#ifdef HAVE_PYSTRING_ASSTRING
PyDict_SetItemString (dict, "ftyp",
PyString_FromStringAndSize (&dirent->ftyp, 1));
#else
PyDict_SetItemString (dict, "ftyp",...
2005 Feb 19
0
[PATCH] check read/write return values
...exit(EXIT_FAILURE);
+ }
}
/**
--- xen-unstable/tools/python/xen/lowlevel/xc/xc.c.warn 2005-02-19 13:10:45.558410335 -0500
+++ xen-unstable/tools/python/xen/lowlevel/xc/xc.c 2005-02-19 14:21:19.323167162 -0500
@@ -461,8 +461,10 @@ static PyObject *pyxc_vmx_build(PyObject
sf2 = PyString_AsString(f2);
lf3 = PyLong_AsLong(f3);
lf4 = PyLong_AsLong(f4);
- sscanf(sf1, "%lx", &lf1);
- sscanf(sf2, "%lx", &lf2);
+ if (sscanf(sf1, "%lx", &lf1) != 1)
+ return NULL;
+ if (sscanf(sf2, "%lx", &lf2) != 1)
+ return...
2014 Nov 04
13
[PATCH 0/9] Small bits of non-Linux porting - #2
Hi,
continuing what started a couple of weeks ago [1], the attached patch
series continues the work in making it easier to build and run
libguestfs (in fixed appliance mode) on OSes different than Linux.
The provided changes should cause no functional changes on Linux.
[1] https://www.redhat.com/archives/libguestfs/2014-October/msg00176.html
Thanks,
--
Pino
Pino Toscano (9):
build: check
2015 Oct 27
1
[PATCH] configure: Move language binding detection to separate files.
This commit starts to split our massive, monolithic configure.ac file
into smaller files, using the m4_include mechanism to combine them.
I don't know if we should really do this, so I'm open to comments
about it. However:
- Our configure.ac script is 1800+ lines long, and that's pretty long.
- configure.ac lacks structure; splitting it up might improve that.
- From what I read,
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
...ame, PyObject **obj_rtn)
return 1;
}
+/* Checks whether a list of strings contains the given name */
+static int
+check_list (PyObject *list, const char *name)
+{
+ ssize_t i = 0;
+ PyObject *elt;
+
+ if (!list)
+ return 0;
+ while ((elt = PyList_GetItem (list, i++))) {
+ char *str = PyString_AsString (elt);
+ if (str && !strcmp (str, name))
+ return 1;
+ }
+ return 0;
+}
+
+/* Does a callback support the given keyword parameter? */
+static int
+callback_has_parameter (PyObject *fn, const char *name)
+{
+ int r = 0;
+ PyObject *inspect, *pname, *spec, *args;
+
+ assert (s...