Python3 compatibility for test_streaming_callback_with_data_in_buffer