Branch: refs/heads/SLE-15-SP2
Home: https://github.com/yast/yast-python-bindings
Commit: 97e597bb9a1f017416b792ed8f5eb6e07dd7fd0f
https://github.com/yast/yast-python-bindings/commit/97e597bb9a1f017416b792ed...
Author: Petr Pavlu
Date: 2021-02-13 (Sat, 13 Feb 2021)
Changed paths:
M src/YPython.cc
Log Message:
-----------
Normalize Python exception values before processing them
An exception value returned by PyErr_Fetch() can be in certain
situations "unnormalized", which means the value does not have to be an
instance of the returned exception type. This typically happens when an
exception is set from a native library. For instance:
PyObject *w = Py_BuildValue("(i,i)", 123, 456);
PyErr_SetObject(NativeError, w);
The exception value is in this case a tuple object and not an instance
of NativeError, until the exception gets normalized.
Code in YPython::PyErrorHandler() passes an obtained exception value
directly to traceback.format_exception(). This method however expects
that the value is already a valid exception object and fails quickly
with an AttributeError when that is not the case. This subsequently
results in an unhandled error in YPython::PyErrorHandler() and in a
SystemError when other Python/C API functions are invoked.
The patch fixes the problem by calling PyErr_NormalizeException() in
YPython::PyErrorHandler() to normalize the value to be an exception
object.
Commit: 9342276816a1333d922ff7ebf9eda64501c5a9c2
https://github.com/yast/yast-python-bindings/commit/9342276816a1333d922ff7eb...
Author: Petr Pavlu
Date: 2021-02-22 (Mon, 22 Feb 2021)
Changed paths:
M src/YPython.cc
Log Message:
-----------
Fix a leaked reference to the traceback module
PyImport_ImportModule("traceback") in YPython::PyErrorHandler() returns
a new reference. Add a call to Py_XDECREF() once the code is done with
the module to avoid leaking its reference.
Commit: e0a2bb6722a29ffe2a53f2a51c3acee50930abd0
https://github.com/yast/yast-python-bindings/commit/e0a2bb6722a29ffe2a53f2a5...
Author: Petr Pavlu
Date: 2021-02-22 (Mon, 22 Feb 2021)
Changed paths:
M package/yast2-python-bindings.changes
M package/yast2-python-bindings.spec
Log Message:
-----------
Bump version & changelog
Commit: ffb87ad4f2898077a9236ecec3e175efb61c06de
https://github.com/yast/yast-python-bindings/commit/ffb87ad4f2898077a9236ece...
Author: David Mulder
Date: 2021-03-31 (Wed, 31 Mar 2021)
Changed paths:
M package/yast2-python-bindings.changes
M package/yast2-python-bindings.spec
M src/YPython.cc
Log Message:
-----------
Merge pull request #36 from petrpavlu/SLE-15-SP2-exception-formatting
Fix backtrace formatting in YPython::PyErrorHandler()
Compare: https://github.com/yast/yast-python-bindings/compare/d3dafb8bf2ee...ffb87ad4...