Not-English characters in path break scoring function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kupfer |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have LANG=ru_RU.UTF-8 and much *.desktop files in the directory ~/.local/
"Программы" it "Programs" in Russian. And kupfer with some circumstances enters catalepsy, making a log
Traceback (most recent call last):
File "/home/
decorator=
File "/home/
reverse=True)
File "/home/
for obj in rankables:
File "/home/
arank = _score(alias, key)*95
File "/home/
if ls[i + 1] in query:
TypeError: 'in <string>' requires string as left operand
The crash of scoring function happens, if the analysis of initial characters of words receives the cyrillic character ("П" in this case) after a hyphen or a blank in the folded application name that is if the previous pressed character has been found to the left of this combination of characters and the current character is found to the right of a combination.
ls[i+1] gives the first byte of utf-8 representation (0xd0 for "П"), but not the first character of a word.
The error does not arise under following conditions
I have moved the "Программы" from a field of view - the error does not arise.
I have returned "Программы" and have renamed to "Programs" - the error does not arise.
I have renamed "Программы" to "0Программы" - the error does not arise.
description: | updated |
Changed in kupfer: | |
status: | Fix Committed → Fix Released |
Thanks for reporting bugs with Kupfer, encoding bugs are important.
I can't reproduce something exactly like that here. However the traceback suggests that the error comes from the *alias* of a program, and what I can see in the code these aliases are not handled correctly with respect to filesystem (filename) encoding. So I have a proposed fix for that problem, I hope that this solves it for you:
http:// git.gnome. org/browse/ kupfer/ commit/ ?id=43d59a28985 59249894a2c14b1 875ee878395ecd