diff options
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index b2cf0cda17..2de6b3e0dd 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -44,6 +44,7 @@ import prserv.serv | |||
44 | import pyinotify | 44 | import pyinotify |
45 | import json | 45 | import json |
46 | import pickle | 46 | import pickle |
47 | import codecs | ||
47 | 48 | ||
48 | logger = logging.getLogger("BitBake") | 49 | logger = logging.getLogger("BitBake") |
49 | collectlog = logging.getLogger("BitBake.Collection") | 50 | collectlog = logging.getLogger("BitBake.Collection") |
@@ -143,7 +144,9 @@ class EventLogWriteHandler: | |||
143 | def write_event(self, event): | 144 | def write_event(self, event): |
144 | with open(self.eventfile, "a") as f: | 145 | with open(self.eventfile, "a") as f: |
145 | try: | 146 | try: |
146 | f.write("%s\n" % json.dumps({"class":event.__module__ + "." + event.__class__.__name__, "vars":json.dumps(pickle.dumps(event)) })) | 147 | str_event = codecs.encode(pickle.dumps(event), 'base64').decode('utf-8') |
148 | f.write("%s\n" % json.dumps({"class": event.__module__ + "." + event.__class__.__name__, | ||
149 | "vars": str_event})) | ||
147 | except Exception as e: | 150 | except Exception as e: |
148 | import traceback | 151 | import traceback |
149 | print(e, traceback.format_exc()) | 152 | print(e, traceback.format_exc()) |