change outbound data format
fix test to support python 3