IIRC, you need to decode this (.decode('utf-8')) otherwise you will get bytes back in Python 3.