balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Windows : index command #25

Closed naeloob closed 4 years ago

naeloob commented 4 years ago

main.py -> get_text funcvtion :

Add : , encoding='utf-8'

    if args.tsv is None:
        stdout_buffer_write(message.encode('utf8'))
    else:
        with open(args.tsv, 'w', encoding='utf-8') as file_:
            file_.write(message)

search/index.py -> index function Change : csv.field_size_limit Add : , encoding='utf-8'

import ctypes
...
    #https://stackoverflow.com/questions/15063936/csv-error-field-larger-than-field-limit-131072
    #csv.field_size_limit(sys.maxsize)
    # It should work on Python 3 and Python 2, on any CPU / OS.
    csv.field_size_limit(int(ctypes.c_ulong(-1).value // 2))

    with open(tsv_filename, encoding='utf-8') as tsv_file: