handle empty metadata in pyout messages more gracefully.
Merge pull request #3766 from StefanKarpinski/master

handle missing metadata in pyout messages more gracefully.