def _str(byte, codec=None):
    """convert bytes to string using the given codec (default is 'ascii')"""
    if codec is False or not hasattr(byte, 'decode'): return byte
    return byte.decode(codec or 'ascii')