Displaying 3 results from an estimated 3 matches for "83a32ea".
2018 Mar 06
1
[PATCH nbdkit] Fix --dump-plugin on perl, python and ruby plugins.
...9,7 +169,7 @@ perl_dump_plugin (void)
{
dSP;
- if (callback_defined ("dump_plugin")) {
+ if (script && callback_defined ("dump_plugin")) {
ENTER;
SAVETMPS;
PUSHMARK (SP);
diff --git a/plugins/python/python.c b/plugins/python/python.c
index b105e53..83a32ea 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -155,7 +155,7 @@ py_dump_plugin (void)
PyObject *fn;
PyObject *r;
- if (callback_defined ("dump_plugin", &fn)) {
+ if (script && callback_defined ("dump_plugin", &fn)) {
PyErr_Cl...
2018 Apr 05
0
[PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.
...([c],[PyUnicode_AsUTF8],
+ [AC_DEFINE([HAVE_PYUNICODE_ASUTF8],1,
+ [Found PyUnicode_AsUTF8 in libpython.])],
+ [],[$PYTHON_BLDLIBRARY])
LIBS="$old_LIBS"
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 83a32ea..02f0d4c 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -103,13 +103,58 @@ callback_defined (const char *name, PyObject **obj_rtn)
return 1;
}
+/* Convert bytes/str/unicode into a string. Caller must free. */
+static char *
+python_to_string (PyObject *str)
+{
+ char...
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.