This used to work fine with rofimoji 6.2.0. Now with 6.3.0, this happens:
$ rofimoji
Traceback (most recent call last):
File "/usr/bin/rofimoji", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/picker/__main__.py", line 9, in main
StandaloneRofimoji().standalone()
File "/usr/lib/python3.12/site-packages/picker/standalone.py", line 25, in standalone
action, value = self.__open_main_selector_window()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/picker/standalone.py", line 48, in __open_main_selector_window
load_recent_characters(self.args.max_recent, self.args.files),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/picker/recent.py", line 8, in load_recent_characters
return [char.strip("\n") for char in __filename_for(files).read_text().strip("\n").split("\n")][:max_recent]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 1027, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 1013, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long: '/home/user/.local/share/rofimoji/recent/arrows-emojis-general_punctuation-geometric_shapes-geometric_shapes_extended-latin-1_supplement-latin_extended-a-letterlike_symbols-mathematical_operators-miscellaneous_symbols-miscellaneous_symbols_and_pictographs-number_forms-ornamental_dingbats-superscripts_and_subscripts-supplemental_symbols_and_pictographs-symbols_and_pictographs_extended-a-transport_and_map_symbols'
I see this is because of how __filename_for is defined:
I have this in my
.config/rofimoji.rc
:This used to work fine with rofimoji 6.2.0. Now with 6.3.0, this happens:
I see this is because of how
__filename_for
is defined:https://github.com/fdw/rofimoji/blob/b3bac50137b75c940a00567a6e3e79730069a129/src/picker/recent.py#L47-L48
Here,
files
comes from either command-line arg--files
or – in my case – from config file itemfiles
.I'm able to work around this by instead abbreviating all the files with wildcards:
But clearly that is not a proper solution.
Perhaps this could be fixed by instead defining
__filename_for
as something like the following: