Displaying 5 results from an estimated 5 matches for "traceback_str".
Did you mean:
traceback_cstr
2019 Nov 23
1
[PATCH nbdkit] python: Print readable tracebacks
...n/python.c b/plugins/python/python.c
index 148097f..71fa2e3 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -167,7 +167,7 @@ print_python_traceback (const char *callback,
type, error, traceback, NULL);
if (rv == NULL)
return -1;
- traceback_str = PyObject_Str (rv);
+ traceback_str = PyUnicode_Join (NULL, rv);
Py_DECREF (rv);
traceback_cstr = python_to_string (traceback_str);
if (traceback_cstr == NULL) {
--
2.21.0
2018 Aug 08
2
[PATCH nbdkit] python: Try harder to print the full traceback on error.
...ing and call nbdkit_error.
+ * https://stackoverflow.com/a/15907460/7126113
+ */
+static int
+print_python_traceback (const char *callback,
+ PyObject *type, PyObject *error, PyObject *traceback)
+{
+ PyObject *module_name, *traceback_module, *format_exception_fn, *rv,
+ *traceback_str;
+ char *traceback_cstr;
+
+#ifdef HAVE_PYSTRING_FROMSTRING
+ module_name = PyString_FromString ("traceback");
+#else
+ module_name = PyUnicode_FromString ("traceback");
+#endif
+ traceback_module = PyImport_Import (module_name);
+ Py_DECREF (module_name);
+
+ /* couldn...
2018 Aug 08
0
Re: [PATCH nbdkit] python: Try harder to print the full traceback on error.
...tackoverflow.com/a/15907460/7126113
> + */
> +static int
> +print_python_traceback (const char *callback,
> + PyObject *type, PyObject *error, PyObject
> *traceback)
> +{
> + PyObject *module_name, *traceback_module, *format_exception_fn, *rv,
> + *traceback_str;
> + char *traceback_cstr;
> +
> +#ifdef HAVE_PYSTRING_FROMSTRING
> + module_name = PyString_FromString ("traceback");
> +#else
> + module_name = PyUnicode_FromString ("traceback");
> +#endif
> + traceback_module = PyImport_Import (module_name);
>...
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
...if (PyString_Check (str))
- return strdup (PyString_AsString (str));
- else
-#endif
- if (PyBytes_Check (str))
+ else if (PyBytes_Check (str))
return strdup (PyBytes_AS_STRING (str));
}
return NULL;
@@ -159,11 +151,7 @@ print_python_traceback (const char *callback,
*traceback_str;
CLEANUP_FREE char *traceback_cstr = NULL;
-#ifdef HAVE_PYSTRING_FROMSTRING
- module_name = PyString_FromString ("traceback");
-#else
module_name = PyUnicode_FromString ("traceback");
-#endif
traceback_module = PyImport_Import (module_name);
Py_DECREF (module_name...
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