"grep-merges" fails with "TypeError: sequence item 0: expected string, NoneType found"

Bug #1663601 reported by Robie Basak on 2017-02-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Medium
Unassigned

Bug Description

$ grep-merges Basak
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

I've been told other people are hitting this, too. At least Xenial (0.155ubuntu2) and Zesty (0.157) are affected. Patch:

--- /usr/bin/grep-merges 2016-07-07 20:12:04.000000000 +0100
+++ /tmp/grep-merges 2017-02-07 00:23:22.802977775 +0000
@@ -61,9 +61,9 @@
         for merge in json.loads(page):
             package = merge['source_package']
             author, uploader = '', ''
- if 'user' in merge:
+ if merge.get('user'):
                 author = merge['user']
- if 'uploader' in merge:
+ if merge.get('uploader'):
                 uploader = '(%s)' % merge['uploader']
             pretty_uploader = ' '.join((author, uploader)).strip()
             if (match is None or

Related branches

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-dev-tools - 0.158

---------------
ubuntu-dev-tools (0.158) experimental; urgency=medium

  * Team upload.

  [ Dmitry Shachnev ]
  * grep-merges: Do not override author or uploader with None.
    There can be JSON entries which have uploader=None. (LP: #1663601)

  [ Colin Watson ]
  * pbuilder-dist, ubuntu-build: Add s390x.

  [ James Page ]
  * grep-merges: Use unicode string format for pretty output to deal with
    non ascii encoding.

  [ Corey Bryant ]
  * pull-uca-source: Added to pull source from Ubuntu Cloud Archive.

 -- Mattia Rizzolo <email address hidden> Wed, 29 Mar 2017 20:07:38 +0200

Changed in ubuntu-dev-tools (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers