def bytechr(i):
    """Return bytestring of one character with ordinal i; 0 <= i < 256."""
    if not 0 <= i < 256:
        if not isinstance(i, int):
            raise TypeError('an integer is required')
        else:
            raise ValueError('bytechr() arg not in range(256)')
    return chr(i).encode('latin1')