I just corrected Ubuntu 5.10 to 15.10 in my description. Sorry.

I could not find where the LOGging of software-center goes so I put in a
couple of print statements and found the following:

* On the first call of software-center after system boot I get an 
"org.freedesktop.Geoclue.Error.notAvailable: Geoclue master client has no 
usable Address providers". The script falls back to _get_region_dumb(), which 
fails for lack of an underscore in the locale.
* On the second call, client.GetAddress() returns rather detailed location 
information, of which the country code is used.

So, the first problem is, why does the Geoclue call fail on first try
and succeed on second.

The second problem is, what can my system use as a fallback, given there
is no country information in my locale. For this I need to know what the
country is used for.

Since nobody here seems to know the answer I dug through a bit of code
and found the following comment (in categories.py):

   """ this build the dict used to substitute menu entries dynamically,
               currently used for the CURRENT_REGION

The country code is put into a dictionary (_template_dict) under the key
CURRENT_REGION. It is then used to make substitutions in many strings
("Utility", "Accessibility", "Settings", etc), none of which, however,
seems at present to contain the CURRENT_REGION key.

I conclude that it is safe for me to use an empty country code as
fallback, by putting the following check into _get_region_dumb():

    if not '_' in loc:
        return res

I still suggest that this is a bug and should be fixed.

** Attachment added: "check for locale without underscore in region.py"
   
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/1535620/+attachment/4580715/+files/patch_region.py

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to software-center in Ubuntu.
https://bugs.launchpad.net/bugs/1535620

Title:
  software-center crashes on locale without underscore

Status in software-center package in Ubuntu:
  New

Bug description:
  I am running Ubuntu 15.10. Some time ago software-center
  (13.10-0ubuntu12) started to crash on the first launch during a
  session. It turned out that software-center tries to determine a
  country code from the locale data (region.py, line 114, in
  _get_region_dumb) by splitting the locale at the underscore. My locale
  ("eo") does not contain an underscore.

  A second launch usually succeeds; I suppose there is another way of
  getting the country information (_get_region_geoclue?). I have no idea
  what the country information is used for, so I would rather not hack
  it.

  In my opinion programs should not depend on an underscore in the
  locale.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/1535620/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to