build: fixup i/o capture for python3