Merge lp:~takluyver/unattended-upgrades/apt-lock-crash into lp:~ubuntu-core-dev/unattended-upgrades/ubuntu

Proposed by Thomas Kluyver
Status: Merged
Merged at revision: 317
Proposed branch: lp:~takluyver/unattended-upgrades/apt-lock-crash
Merge into: lp:~ubuntu-core-dev/unattended-upgrades/ubuntu
Diff against target: 13 lines (+2/-1)
1 file modified
unattended-upgrade (+2/-1)
To merge this branch: bzr merge lp:~takluyver/unattended-upgrades/apt-lock-crash
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+133482@code.launchpad.net

Description of the change

I ran into a bytes/unicode crash on Quantal, and while fixing it, I noticed that a variable could end up undefined.

I can't get it to go into that code path now, but this change should fix things if it does end up there.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, I merged this to trunk (and added a test).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unattended-upgrade'
2--- unattended-upgrade 2012-10-09 08:10:08 +0000
3+++ unattended-upgrade 2012-11-08 14:08:26 +0000
4@@ -722,7 +722,8 @@
5 cache, [pkg.name for pkg in pkgs_to_upgrade], logfile_dpkg)
6 except Exception as e:
7 # print unhandled exceptions here this way, while stderr is redirected
8- os.write(old_stderr, "Exception: %s" % e)
9+ os.write(old_stderr, ("Exception: %s\n" % e).encode('utf-8'))
10+ pkg_install_success = False
11
12 # restore
13 os.dup2(old_stdout, 1)

Subscribers

People subscribed via source and target branches

to all changes: