def uu_encode(input,errors='strict',filename='<data>',mode=0666):

    """ Encodes the object input and returns a tuple (output
        object, length consumed).

        errors defines the error handling to apply. It defaults to
        'strict' handling which is the only currently supported
        error handling for this codec.

    """
    assert errors == 'strict'
    from cStringIO import StringIO
    from binascii import b2a_uu
    # using str() because of cStringIO's Unicode undesired Unicode behavior.
    infile = StringIO(str(input))
    outfile = StringIO()
    read = infile.read
    write = outfile.write

    # Encode
    write((mode & 0777, filename) % 'begin %o %s\n')
    chunk = read(45)
    while chunk:
        write(b2a_uu(chunk))
        chunk = read(45)
    write(' \nend\n')

    return (outfile.getvalue(), len(input))
dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/encodings/uu_codec.py/uu_encode/swapped operands of `%`