better detection of python script; emit information when json syntax is broken