votes up 1

unicode strings are not supported, please encode to bytes: (!r)

Package:
Exception Class:
TypeError

Raise code

    if isinstance(seq, bytes):
        return seq
    elif isinstance(seq, bytearray):
        return bytes(seq)
    elif isinstance(seq, memoryview):
        return seq.tobytes()
    elif isinstance(seq, unicode):
        raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
    else:
        # handle list of integers and bytes (one or more items) for Python 2 and 3
        return bytes(bytearray(seq))


# create control bytes
XON = to_bytes([17])
😲 Agile task management is now easier than calling a taxi. #Tracklify

Ways to fix

votes up 0 votes down

Apr 17, 2022 adiraveeresh answer

Add a possible fix

Please authorize to post fix