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

Bug #1663601 reported by Robie Basak
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Fix Released
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

Tags: patch

Related branches

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.