Add python 3 support in dumpstream (issue #3475)