Merge lp:~mitya57/ubuntu-dev-tools/grep-merges-fix into lp:~ubuntu-dev/ubuntu-dev-tools/trunk

Proposed by Dmitry Shachnev on 2016-04-27
Status: Merged
Merged at revision: 1448
Proposed branch: lp:~mitya57/ubuntu-dev-tools/grep-merges-fix
Merge into: lp:~ubuntu-dev/ubuntu-dev-tools/trunk
Diff against target: 15 lines (+2/-2)
1 file modified
grep-merges (+2/-2)
To merge this branch: bzr merge lp:~mitya57/ubuntu-dev-tools/grep-merges-fix
Reviewer Review Type Date Requested Status
Martin Pitt 2016-04-27 Approve on 2016-05-13
Stefano Rivera 2016-05-02 Pending
Benjamin Drung 2016-05-02 Pending
Review via email: mp+293074@code.launchpad.net

Description of the change

This line:

{u'uploaded': u'outstanding', u'source_package': u'xfce4-whiskermenu-plugin', u'age': 25, u'right_version': u'1.5.2-1', u'link': u'https://merges.ubuntu.com/x/xfce4-whiskermenu-plugin/', u'user': None, u'uploader': None, u'short_description': u'merge 1.5.2-1', u'base_version': u'1.5.1-1', u'binaries': [u'xfce4-whiskermenu-plugin'], u'left_version': u'1.5.1-1ubuntu1'}

can lead to the following error:

Traceback (most recent call last):
  File "/usr/bin/grep-merges", line 74, in <module>
    main()
  File "/usr/bin/grep-merges", line 68, in main
    pretty_uploader = ' '.join((author, uploader)).strip()
TypeError: sequence item 0: expected string, NoneType found

This merge proposal fixes that issue.

To post a comment you must log in.
Martin Pitt (pitti) wrote :

Looks good in general, I just have a style/simplification/robustification nitpick. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'grep-merges'
2--- grep-merges 2012-05-06 03:24:14 +0000
3+++ grep-merges 2016-04-27 10:09:33 +0000
4@@ -61,9 +61,9 @@
5 for merge in json.loads(page):
6 package = merge['source_package']
7 author, uploader = '', ''
8- if 'user' in merge:
9+ if 'user' in merge and merge['user'] is not None:
10 author = merge['user']
11- if 'uploader' in merge:
12+ if 'uploader' in merge and merge['uploader'] is not None:
13 uploader = '(%s)' % merge['uploader']
14 pretty_uploader = ' '.join((author, uploader)).strip()
15 if (match is None or