Replace byte/unicode helpers in test_capture with python level syntax.