fixed issues with encoding of std* communications in python3