[Bug 1069019] Re: [software-properties-gtk] can not delete, enable or modify any software source with non-ASCII characters in the comment

Julian Andres Klode juliank at ubuntu.com
Thu Mar 20 19:27:42 UTC 2014


I believe we should fix this in software-properties.  The most flexible
way to do this is to use something like

if sys.getfilesystemencoding() == "ascii" and not "LANG" in os.environ:
    os.putenv("LANG", "C.UTF-8")
    with open("/etc/default/locale") as fobj:
        for line in fobj:
            line = line.split("#")[0].strip()
            if line:
                key, value = line.split("=", 1)
                os.putenv(key, value)

        os.execv(sys.argv[0], sys.argv)

before running other code in the dbus service. This will take care to
setup the system's default locale settings and then re-exec() itself  so
that Python picks this up (it will not change filesystem encoding
otherwise). In case no locale is set in /etc/default/locale, it falls
back to LANG=C.UTF-8.

This can be changed to use systemd's localed later on (I do not know if
it is currently installed), using:

	bus = dbus.SystemBus()
	localed = bus.get_object("org.freedesktop.locale1", "/org/freedesktop/locale1")
	loc = dbus.Interface(localed, 'org.freedesktop.locale1')
	props = dbus.Interface(localed, 'org.freedesktop.DBus.Properties')

	for locale in props.Get('org.freedesktop.locale1', 'Locale'):
		name, val = locale.split("=", 1)
		os.putenv(name, val)

to get the values instead of reading /etc/default/locale.

** Package changed: python-apt (Ubuntu) => software-properties (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/1069019

Title:
  [software-properties-gtk] can not delete, enable or modify any
  software source with non-ASCII characters in the comment

Status in “software-properties” package in Ubuntu:
  Triaged
Status in “software-properties” source package in Saucy:
  Triaged

Bug description:
  I've tried to reenable PPA's after upgrading the system, so there is
  no reaction on delete button and no any changes after modifying data
  via modify dialog. I can't even enable a source.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: software-properties-gtk 0.92.9
  ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
  Uname: Linux 3.5.0-17-generic i686
  ApportVersion: 2.6.1-0ubuntu4
  Architecture: i386
  Date: Sat Oct 20 16:07:59 2012
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
  MarkForUpload: True
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=ru_RU.UTF-8
   SHELL=/bin/bash
  SourcePackage: software-properties
  UpgradeStatus: Upgraded to quantal on 2012-10-19 (1 days ago)

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



More information about the foundations-bugs mailing list