[Bug 1058038] Re: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 18-25: ordinal not in range(128)

Nicolas Delvaux 1058038 at bugs.launchpad.net
Sat Oct 6 13:59:53 UTC 2012


This is indeed a unicode problem.
The strange thing is that it works when killing and launching aptd from the command line.

According to http://docs.python.org/py3k/howto/unicode.html#unicode-filenames , this is because the LANG environment variable is not set when aptd is spawned by the sotware-center. In this case, the default encoding for pathes is ASCII.
I hacked arround and was able to confirm this (by writing os.environ in a file).

So here is the bug.
Though, I'm not sure about the best way to fix it.

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

Title:
  <class 'UnicodeEncodeError'>: 'ascii' codec can't encode characters in
  position 18-25: ordinal not in range(128)

Status in “aptdaemon” package in Ubuntu:
  Confirmed

Bug description:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 1181, in _simulate
      trans.unauthenticated, trans.high_trust_packages = self.__simulate(trans)
    File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 1239, in __simulate
      deb = self.install_file(trans, simulate=True, **trans.kwargs)
    File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 740, in install_file
      deb = self._check_deb_file(trans, path, force)
    File "/usr/lib/python3/dist-packages/aptdaemon/worker.py", line 1326, in _check_deb_file
      if not os.path.isfile(path):
    File "/usr/lib/python3.2/genericpath.py", line 29, in isfile
      st = os.stat(path)
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 18-25: ordinal not in range(128)

  ProblemType: Crash
  DistroRelease: Ubuntu 12.10
  Package: aptdaemon 0.45+bzr861-0ubuntu5
  ProcVersionSignature: Ubuntu 3.5.0-15.23-generic 3.5.4
  Uname: Linux 3.5.0-15-generic i686
  Annotation: Installation of the package file failed
  ApportVersion: 2.5.2-0ubuntu4
  Architecture: i386
  Date: Fri Sep 28 16:53:16 2012
  ExecutablePath: /usr/sbin/aptd
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Beta i386 (20120926)
  PackageArchitecture: all
  SourcePackage: aptdaemon
  Title: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 18-25: ordinal not in range(128)
  TransactionDepends: [[], [], [], [], [], [], []]
  TransactionErrorCode: error-unknown
  TransactionKwargs: {'path': dbus.String('/home/silentlight/Загрузки/google-chrome-stable_current_i386.deb'), 'force': dbus.Boolean(False)}
  TransactionLocale: ru_RU.UTF-8
  TransactionOutput:
   
  TransactionPackages: [[], [], [], [], [], []]
  TransactionRole: role-install-file
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/1058038/+subscriptions




More information about the foundations-bugs mailing list