[Bug 1039484] Re: Accents in sources.list breaks do-release-upgrade

Michael Vogt michael.vogt at ubuntu.com
Wed Sep 19 14:31:47 UTC 2012


My assumption would be that entry.comment is a byte string and _() returns a python3 str so python tries to convert to bytes and fails:
     entry.comment += " " + _("disabled on upgrade to %s") % self.toDist

(or vice vera). It would be great to write a testcase for this.

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

Title:
  Accents in sources.list breaks do-release-upgrade

Status in “python-apt” package in Ubuntu:
  In Progress
Status in “python-apt” source package in Quantal:
  In Progress

Bug description:
  Description:	Ubuntu 12.04.1 LTS
  Release:	12.04

  update-manager:
    Installed: 1:0.156.14.9

  In my sources.list I had some lines with an accent ("í" in "Víctor"),
  like this one:

  deb https://XXXX@private-ppa.launchpad.net/XXX precise main #Personal
  access of Víctor R. Ruiz (vrruiz)

  Doing an "upgrade-manager -d" and clicking for upgrade to Quantal (do-
  release-upgrade), I repeatedly got this error:

  WARNING: Failed to read mirror file
  Traceback (most recent call last):
    File "/tmp/update-manager-ir3uWg/quantal", line 10, in <module>
      sys.exit(main())
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeMain.py", line 235, in main
      if app.run():
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 1736, in run
      return self.fullUpgrade()
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 1638, in fullUpgrade
      if not self.updateSourcesList():
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 711, in updateSourcesList
      if not self.rewriteSourcesList(mirror_check=True):
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 686, in rewriteSourcesList
      entry.comment += " " + _("disabled on upgrade to %s") % self.toDist
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeViewGtk3.py", line 475, in _handleException
      apport_crash(type, value, tb)
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeApport.py", line 47, in apport_crash
      _apport_append_logfiles(report)
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeApport.py", line 28, in _apport_append_logfiles
      report[f.replace(".","").replace("-","")] = (open(f), )
    File "/usr/lib/python2.7/dist-packages/problem_report.py", line 509, in __setitem__
      assert k.replace('.', '').replace('-', '').replace('_', '').isalnum()
  AssertionError

  Original exception was:
  Traceback (most recent call last):
    File "/tmp/update-manager-ir3uWg/quantal", line 10, in <module>
      sys.exit(main())
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeMain.py", line 235, in main
      if app.run():
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 1736, in run
      return self.fullUpgrade()
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 1638, in fullUpgrade
      if not self.updateSourcesList():
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 711, in updateSourcesList
      if not self.rewriteSourcesList(mirror_check=True):
    File "/tmp/update-manager-ir3uWg/DistUpgrade/DistUpgradeController.py", line 686, in rewriteSourcesList
      entry.comment += " " + _("disabled on upgrade to %s") % self.toDist
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)

  The error was gone when I modified sources.list and replaced the
  accent with an ASCII character ("í" -> "i").

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1039484/+subscriptions




More information about the foundations-bugs mailing list