All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] event: Fix subprocess event error traceback failures
@ 2015-12-09 12:02 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-12-09 12:02 UTC (permalink / raw)
  To: bitbake-devel

If subprocess raises a CalledProcessError() error, e.g. from a call
like subprocess.check_call("false"), bitbake would try and pass the
object over IPC and fail, leading to an unusual error:

('__init__() takes at least 3 arguments (1 given)', <class 'subprocess.CalledProcessError'>, ())%

To avoid this, we turn the value into a string which prevents the
issues the IPC has trying to deal with the object (for the same reason
we deal with tracebacks here too).

[YOCTO #8752]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bitbake/lib/bb/event.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 366bc41..ec25ce7 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -595,6 +595,8 @@ class LogHandler(logging.Handler):
             etype, value, tb = record.exc_info
             if hasattr(tb, 'tb_next'):
                 tb = list(bb.exceptions.extract_traceback(tb, context=3))
+            # Need to turn the value into something the logging system can pickle
+            value = str(value)
             record.bb_exc_info = (etype, value, tb)
             record.exc_info = None
         fire(record, None)




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-09 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-09 12:02 [PATCH] event: Fix subprocess event error traceback failures Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.