TST: fix TypeError: string argument expected, got 'bytes' on Py3