Merge lp:~brian-murray/ubuntu-archive-tools/unicode-traceback into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 990
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/unicode-traceback
Merge into: lp:ubuntu-archive-tools
Diff against target: 42 lines (+5/-3)
1 file modified
phased-updater (+5/-3)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/unicode-traceback
Reviewer Review Type Date Requested Status
Ubuntu Package Archive Administrators Pending
Review via email: mp+285408@code.launchpad.net

Description of the change

Resolve the following Traceback:

Traceback (most recent call last):
  File "/home/ubuntu-archive/ubuntu-archive-tools/phased-updater", line 672, in <module>
    main()
  File "/home/ubuntu-archive/ubuntu-archive-tools/phased-updater", line 639, in main
    create_email_notifications(releases, issues)
  File "/home/ubuntu-archive/ubuntu-archive-tools/phased-updater", line 320, in create_email_notifications
    bucket, pkg, version))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 21: ordinal not in range(128)

This happened with 3v1nO who has hidden their email address and then has unicode in the Changed-By line of the changes file.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phased-updater'
2--- phased-updater 2015-06-26 16:35:49 +0000
3+++ phased-updater 2016-02-08 20:52:16 +0000
4@@ -262,6 +262,7 @@
5 signer_name = ''
6 # if we can't determine their email use the changes file
7 changes_file_url = spph.changesFileUrl()
8+ # need to handle a 404 here
9 changes_file = urlopen(changes_file_url)
10 for line in changes_file.readlines():
11 line = line.strip()
12@@ -311,12 +312,13 @@
13 smtp = smtplib.SMTP('localhost')
14 smtp.sendmail(EMAIL_SENDER, receivers,
15 msg.as_string())
16+ smtp.quit()
17 logging.info('%s mailed about %s' % (receivers, subject))
18- smtp.quit()
19 # add signer, problem, pkg, version to notifications csv file
20 with open(NOTIFICATIONS, 'a') as notify_file:
21 for bucket in spph_buckets[rname][spph]['buckets']:
22- notify_file.write('%s, %s, %s, %s\n' % (signer_name,
23+ notify_file.write('%s, %s, %s, %s\n' % \
24+ (signer_name.encode('utf-8'),
25 bucket, pkg, version))
26 if 'rate' in spph_buckets[rname][spph]:
27 # see if they have been emailed about the increased rate
28@@ -344,13 +346,13 @@
29 smtp = smtplib.SMTP('localhost')
30 smtp.sendmail(EMAIL_SENDER, receivers,
31 msg.as_string())
32+ smtp.quit()
33 logging.info('%s mailed about %s' % (receivers, subject))
34 # add signer, increased-rate, pkg, version to
35 # notifications csv
36 with open(NOTIFICATIONS, 'a') as notify_file:
37 notify_file.write('%s, increased-rate, %s, %s\n' %
38 (signer.name, pkg, version))
39- smtp.quit()
40
41
42 def new_buckets(archive, release, src_pkg, version):

Subscribers

People subscribed via source and target branches