MarkHedleyJones / dmenu-extended

An extension to dmenu for quickly opening files and folders.
MIT License
387 stars 33 forks source link

Cache build error #160

Open evcastelani opened 1 year ago

evcastelani commented 1 year ago

When I rebuilt the cache, this error occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/dmenu_extended/main.py", line 775, in cache_save
    f.write(item + "\n")
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcf3' in position 58: surrogates not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/dmenu_extended_cache_build", line 8, in <module>
    sys.exit(build_cache())
  File "/usr/local/lib/python3.10/dist-packages/dmenu_extended/main.py", line 2270, in build_cache
    d.build_cache()
  File "/usr/local/lib/python3.10/dist-packages/dmenu_extended/main.py", line 1237, in build_cache
    self.cache_save(filenames, file_cache_files)
  File "/usr/local/lib/python3.10/dist-packages/dmenu_extended/main.py", line 805, in cache_save
    f.write(item + "\n")
TypeError: a bytes-like object is required, not 'str'

I've seen that bugs of this type have been fixed over time, but I don't know how to fix this one. Any suggestion? I've been using version 1.2.1