Unable to json_encode the new ddoc_updated event

Details

Description

I notice a behaviour of the update_notification process that I cannot
understand.
I setup CouchDB to send update notifications to an external process in my
local.d/example.ini:

[update_notification]
example = /usr/local/bin/example.py

The script example.py keeps reading lines from stdin and simply logs.
Everything seems to work fine when a normal document is
created/modified/deleted
in a db; the scripts receives the expected notification line:

{"type":"updated","db":"example_db"}

The problem arises when a DESIGN document gets modified in example_db. In
this
case the script is relaunched and I notice the following in CouchDB logs: