update-software-center does not work properly in Turkish locales
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-center (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Lucid |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: software-center
Hello,
After trying out Ubuntu 10.04 with a Turkish locale (tr_TR.UTF-8), I was
sad to notice that when update-
a manual command line interaction, it produces errors similar to the following:
(I was able to reproduce this with software-center 2.0.3.)
=== 8< ===
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
WARNING:root:error processing: /usr/share/
=== >8 ===
The end result of this is that a lot of the installed software cannot be
seen in the Ubuntu Software Center, which is a very big usability problem
for people using a Turkish locale. (After running update-
in the English locale [en_US.UTF-8], one can see 67 programs in the
"Installed Software" menu. With the Turkish locale [tr_TR.UTF-8], this
number drops to 40.)
Notice in the output above that the "i" is not capitalized in the keyword
"WEIGHT_
with programs which run in the Turkish locale, but that expect the
capitalization of "i" to work as in the English alphabet (i.e. in ASCII).
Unfortunately, in the Turkish alphabet the capitalization rules of the "i"s
are different:
=== 8< ===
English:
lowercase: i
uppercase: I
Turkish:
Dotless "i":
lowercase: ı (idotless)
uppercase: I
"i" with dot:
lowercase: i
uppercase: İ (Idotabove)
=== >8 ===
The source of this problem can be seen in the following file:
=== /usr/share/
191 # now add search data from the desktop file
192 for key in ["GenericName"
193 if not parser.
194 continue
195 s = parser.
196 w = globals(
197 term_generator.
=== /usr/share/
As you can see, on line 196, the string "key", which contains ASCII data such
as "GenericName", is capitalized using the "upper" function.
Because the data to be operated on is ASCII, but the locale is a Turkish locale,
this causes problems when one tries to capitalize an "i".
The attached patch fixes this issue by creating a function called ascii_upper
which uses the the "string.maketrans" and "string.translate" functions and the
"string.
case ASCII strings to uppercase ASCII strings using English capitalization rules.
Dear Ubuntu Software Center maintainer: Because this is a high profile bug that
affects everyone running in a Turkish locale, and because its fix is relatively
simple, is there any way we can get this bug fixed in Ubuntu 10.04 LTS ? Because
this is a LTS release, I really don't want Turkish users to have a suboptimal
experience during the 3 years this release is supported.
I realize that I should have tested an alpha or beta version of Ubuntu 10.04 LTS
and reported this bug earlier. I apologize for not doing this.
Regards,
M. Vefa Bicakci
TEST CASE:
1. install turkish locale:
$ sudo apt-get install language-
2. from a terminal run the following command and note any error message:
$ sudo LC_ALL=tr_TR.UTF8 update-
3. run software-center
4. Select "installed software" and note the number of items on the status bar
5. from a terminal run the following command:
$ sudo LC_ALL=C update-
6. run software-center
7. Select "installed software" and note the number of items on the status bar
8. Compare the number of items in steps 4 and 7
VERIFICATION FAILED:
1. install software-center from -updates
2. The following messages are printed on the terminal output:
WARNING:root:error processing: /usr/share/
3. The numbers of items between tr_TR.utf8 and C locales are differents
VERIFICATION SUCCEEDED:
1. install software-center from -proposed (2.0.5)
2. No error message is printed on the terminal
3. The numbers of items are the same.
tags: |
added: patch removed: center locale software turkish ubuntu |
tags: | added: testcase |
I can reproduce the bug, it is indeed pretty bad for users with a Turkish locale.
I can also confirm that the attached patch fixes the issue.
Note that this is the only place in the code where str.upper() is called, but there are several other places in the code where str.lower() is called, so this is potentially an issue for non unicode strings. This will need more investigation.
In the meantime I recommend the importance of this bug be set to high and the fix be merged as soon as possible.