Project

General

Profile

Bug #1491

OutputPyJson fails with exception in single_thread mode

Added by Rogers, Chris over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Python API
Target version:
Start date:
20 June 2014
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

OutputPyJson is failing with:

Traceback (most recent call last):
  File "/home/jenkins/workspace/MAUS_sl64/bin/utilities/root_to_json.py", line 40, in <module>
    run()
  File "/home/jenkins/workspace/MAUS_sl64/bin/utilities/root_to_json.py", line 37, in run
    my_output, io.StringIO(u""))
  File "/home/jenkins/workspace/MAUS_sl64/src/common_py/Go.py", line 131, in __init__
    self.get_job_footer())
  File "/home/jenkins/workspace/MAUS_sl64/src/common_py/framework/single_thread.py", line 96, in execute
    self.process_event(event)
  File "/home/jenkins/workspace/MAUS_sl64/src/common_py/framework/single_thread.py", line 130, in process_event
    event_json = json.loads(event)
  File "/home/jenkins/workspace/MAUS_sl64/third_party/install/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/home/jenkins/workspace/MAUS_sl64/third_party/install/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/jenkins/workspace/MAUS_sl64/third_party/install/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Patch is:

=== modified file 'src/common_py/framework/single_thread.py'
--- src/common_py/framework/single_thread.py    2014-06-19 15:24:48 +0000
+++ src/common_py/framework/single_thread.py    2014-06-20 10:23:08 +0000
@@ -127,7 +127,7 @@
         Process a single event - if it is a Spill, check for run_number change
         and call EndOfEvent/StartOfEvent if run_number has changed.
         """ 
-        event_json = json.loads(event)
+        event_json = maus_cpp.converter.json_repr(event)
         if DataflowUtilities.get_event_type(event_json) == "Spill":
             current_run_number = DataflowUtilities.get_run_number(event_json)
             if (DataflowUtilities.is_end_of_run(event_json)):
#1

Updated by Rogers, Chris about 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This is done.

Also available in: Atom PDF