Public bug reported:

# lsb_release -rd
Description:    Ubuntu 15.10
Release:        15.10

# apt-cache policy python3-distupgrade
python3-distupgrade:
  Installed: 1:15.10.14.4
  Candidate: 1:15.10.14.4
  Version table:
 *** 1:15.10.14.4 0
        500 http://ca.archive.ubuntu.com/ubuntu/ wily-updates/main amd64 
Packages
        100 /var/lib/dpkg/status
     1:15.10.13 0
        500 http://ca.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages


I am a Lubuntu AMD64 user. I was on Lubuntu 14.10 and needed to upgrade. After 
successfully upgrading to vivid/15.04, I then tried to upgrade to wily/15.10. 
In both cases, I used the alternate ISO.

First, I downloaded the ISO file and mounted it to my local file system:

# sudo mount -o loop ~/Desktop/x220/lubuntu-15.10-alternate-amd64.iso
/mnt

Second, I executed the upgrade script and chose the 'no network' option:

# sudo /mnt/cdromupgrade

But it failed early in the sequence of events. The relevant part of the
/var/log/dist-upgrade/main.log file showed the following:

2016-02-28 12:19:17,788 ERROR not handled exception:
Traceback (most recent call last):

  File "/tmp/tmp.vQLpNb1AlJ/wily", line 8, in <module>
    sys.exit(main())

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeMain.py", line 240, in main
    if app.run():

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeController.py", line 1837, 
in run
    return self.fullUpgrade()

  File "/tmp/tmp.vQLpNb1AlJ/DistUpgrade/DistUpgradeController.py", line 1729, 
in fullUpgrade
    not self.aptcdrom.add(self.sources_backup_ext)):

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", 
line 306, in add
    res = self._doAdd()

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", 
line 264, in _doAdd
    if self._verifyRelease(self.signatures):

  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeAptCdrom.py", 
line 227, in _verifyRelease
    sum = apt_pkg.sha256sum(open(fp))

TypeError: invalid file: <_io.TextIOWrapper
name='/mnt/dists/wily/restricted/debian-installer/binary-
amd64/Packages.gz' mode='r' encoding='UTF-8'>

After some detective work, I was able to upgrade to wily by removing the
'open' call in line 227:

    sum = apt_pkg.sha256sum(fp)

An important step in the detective work was to inspect the changes to the 
DistUpgradeAptCdrom.py file
(http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu-release-upgrader/trunk/revision/2859#tests/test_sources_list.py).
There, we can see that the line:

sum = apt_pkg.sha256sum(open(f))

was changed to:

with open(f) as fp:
    sum = apt_pkg.sha256sum(open(fp))

The end result is that a call to open() was changed to use a with/as
statement, as part of a substantial commit to improve the robustness of
the code. But for this line, it introduced two open calls instead of
just one, and that is clearly wrong, as the first open call will return
a File object, and the second will try to open the consequent File
object, which will result in a Type error.

Revision 2859 was done about a year ago, and refers to LP #1409555,
which seems to indicate that the fix was added in 15.04. It explains why
I was able to upgrade to 15.04 but not to 15.10.

** Affects: ubuntu-release-upgrader (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "main.log"
   https://bugs.launchpad.net/bugs/1551929/+attachment/4585875/+files/main.log

** Summary changed:

- Cannot upgrade to 15.10 using alternate AMD64 CD
+ Cannot upgrade to 15.10 using alternate AMD64 ISO

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

Title:
  Cannot upgrade to 15.10 using alternate AMD64 ISO

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1551929/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to