Python programs wont start with locale variables set to sr_RS and sr_RS@latin

Bug #463654 reported by Slobodan Simić
52
This bug affects 11 people
Affects Status Importance Assigned to Milestone
python2.6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: software-center

I cannot get software center to work with my locales setting.
When I try to start it from console I get

slobodan@koala:~$ software-center
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkWidget::visited-link-color' of type `GdkColor' from rc file value "((GString*) 0x19df880)" of type `GString'
Traceback (most recent call last):
  File "/usr/bin/software-center", line 80, in <module>
    app = SoftwareCenterApp(datadir, xapian_base_path)
  File "/usr/share/software-center/softwarecenter/app.py", line 140, in __init__
    self.icons, datadir)
  File "/usr/share/software-center/softwarecenter/view/availablepane.py", line 58, in __init__
    SoftwarePane.__init__(self, cache, db, icons, datadir)
  File "/usr/share/software-center/softwarecenter/view/softwarepane.py", line 92, in __init__
    self.datadir)
  File "/usr/share/software-center/softwarecenter/view/appdetailsview.py", line 102, in __init__
    self.aptd_client = client.AptClient()
  File "/usr/lib/python2.6/dist-packages/aptdaemon/client.py", line 382, in __init__
    self._locale = "%s.%s" % locale.getdefaultlocale()
  File "/usr/lib/python2.6/locale.py", line 478, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: sr_RS

When I change LANG variable to something else (tried en_US de_DE hu_HU)
software-center starts normally.

ProblemType: Bug
Architecture: amd64
Date: Thu Oct 29 20:33:15 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release Candidate amd64 (20091020.3)
NonfreeKernelModules: fglrx
Package: software-center 1.0.2
PackageArchitecture: all
ProcEnviron:
 LANG=en_US
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: software-center
Uname: Linux 2.6.31-14-generic x86_64
XsessionErrors:
 (gnome-settings-daemon:4111): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (polkit-gnome-authentication-agent-1:4217): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (nautilus:4210): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (gnome-panel:4209): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1 and height 24
 (gnome-panel:4209): Gdk-WARNING **: /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

Revision history for this message
Slobodan Simić (slsimic) wrote :
Revision history for this message
Zarko Mihajlovic (developer-beotel) wrote :

This bug affects two of mine computers, desktop and laptop, both set with serbian locale sr_RS:

zarko@zarko-desktop:~$ software-center
Traceback (most recent call last):
  File "/usr/bin/software-center", line 80, in <module>
    app = SoftwareCenterApp(datadir, xapian_base_path)
  File "/usr/share/software-center/softwarecenter/app.py", line 140, in __init__
    self.icons, datadir)
  File "/usr/share/software-center/softwarecenter/view/availablepane.py", line 58, in __init__
    SoftwarePane.__init__(self, cache, db, icons, datadir)
  File "/usr/share/software-center/softwarecenter/view/softwarepane.py", line 92, in __init__
    self.datadir)
  File "/usr/share/software-center/softwarecenter/view/appdetailsview.py", line 102, in __init__
    self.aptd_client = client.AptClient()
  File "/usr/lib/python2.6/dist-packages/aptdaemon/client.py", line 382, in __init__
    self._locale = "%s.%s" % locale.getdefaultlocale()
  File "/usr/lib/python2.6/locale.py", line 478, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: sr_RS

Moreover, even the Alacarte wont start with similar error report:

zarko@zarko-desktop:~$ alacarte
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 36, in <module>
    main()
  File "/usr/bin/alacarte", line 32, in main
    app = MainWindow(datadir, version, sys.argv)
  File "/usr/lib/pymodules/python2.6/Alacarte/MainWindow.py", line 48, in __init__
    self.editor = MenuEditor()
  File "/usr/lib/pymodules/python2.6/Alacarte/MenuEditor.py", line 35, in __init__
    self.locale = locale.getdefaultlocale()[0]
  File "/usr/lib/python2.6/locale.py", line 478, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: sr_RS

Revision history for this message
Slobodan Simić (slsimic) wrote :

I think this bug is Python related and not software-center related since I get similar errors with wicd-client wich is python based too.

Revision history for this message
Petar Vasić (p-vasic) wrote :

This is a python bug, as it shows up in every python program.

affects: software-center (Ubuntu) → python2.6 (Ubuntu)
Petar Vasić (p-vasic)
summary: - software center wont start with my locale variables set to sr_RS
+ Python programs wont start with locale variables set to sr_RS and
+ sr_RS@latin
Revision history for this message
Petar Vasić (p-vasic) wrote :

Runing
 cd /usr/lib/python2.6/
 python locale.py

when your $LANG is set to " sr_RS@latin" (serbian localization) results in:

Locale aliasing:

Locale defaults as determined by getdefaultlocale():
------------------------------------------------------------------------
Traceback (most recent call last):
  File "locale.py", line 1739, in <module>
    _print_locale()
  File "locale.py", line 1685, in _print_locale
    lang, enc = getdefaultlocale()
  File "locale.py", line 478, in getdefaultlocale
    return _parse_localename(localename)
  File "locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: sr_RS@latin

Revision history for this message
Petar Vasić (p-vasic) wrote :

Upstream report is here: http://bugs.python.org/issue6668

Changed in python2.6 (Ubuntu):
status: New → Confirmed
Revision history for this message
Petar Vasić (p-vasic) wrote :
Revision history for this message
Jovica Lesevic (jovica-lesevic) wrote :

 The package from Jonathan Marsden ( ppa ) fixes errors I've been seeing on my Ubuntu Karmic installation."

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.