ENH Return a str from detect_format() in Python 3