search for: pyerr_normalizeexcept

Displaying 5 results from an estimated 5 matches for "pyerr_normalizeexcept".

2018 Apr 05
1
Re: [PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.
...onvert the Python exception to a string. > + * https://stackoverflow.com/a/1418703 > + * But forget about the traceback, it's very hard to print. > + * https://stackoverflow.com/q/1796510 > + */ > + PyErr_Fetch (&type, &error, &traceback); > + PyErr_NormalizeException (&type, &error, &traceback); > + error_str = PyObject_Str (error); > + error_cstr = python_to_string (error_str); > + nbdkit_error ("%s: %s: error: %s", > + script, callback, error_cstr ? : "<unknown>"); Okay, not the f...
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.
2018 Aug 08
2
[PATCH nbdkit] python: Try harder to print the full traceback on error.
...error, *traceback; - /* Convert the Python exception to a string. - * https://stackoverflow.com/a/1418703 - * But forget about the traceback, it's very hard to print. - * https://stackoverflow.com/q/1796510 - */ PyErr_Fetch (&type, &error, &traceback); PyErr_NormalizeException (&type, &error, &traceback); - error_str = PyObject_Str (error); - error_cstr = python_to_string (error_str); - nbdkit_error ("%s: %s: error: %s", - script, callback, - error_cstr ? error_cstr : "<unknown>"); - P...
2018 Aug 08
0
Re: [PATCH nbdkit] python: Try harder to print the full traceback on error.
...onvert the Python exception to a string. > - * https://stackoverflow.com/a/1418703 > - * But forget about the traceback, it's very hard to print. > - * https://stackoverflow.com/q/1796510 > - */ > PyErr_Fetch (&type, &error, &traceback); > PyErr_NormalizeException (&type, &error, &traceback); > - error_str = PyObject_Str (error); > - error_cstr = python_to_string (error_str); > - nbdkit_error ("%s: %s: error: %s", > - script, callback, > - error_cstr ? error_cstr : "<u...
2018 Apr 05
0
[PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.
...char *error_cstr; + + /* Convert the Python exception to a string. + * https://stackoverflow.com/a/1418703 + * But forget about the traceback, it's very hard to print. + * https://stackoverflow.com/q/1796510 + */ + PyErr_Fetch (&type, &error, &traceback); + PyErr_NormalizeException (&type, &error, &traceback); + error_str = PyObject_Str (error); + error_cstr = python_to_string (error_str); + nbdkit_error ("%s: %s: error: %s", + script, callback, error_cstr ? : "<unknown>"); + Py_DECREF (error_str); + fre...