git review list fails with newer gerrit versions

Bug #1754289 reported by Simon Sudler
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
git-review (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The trusty git-review packages list command fails with newer versions of gerrit:

$ git review --list
Traceback (most recent call last):
  File "/usr/bin/git-review", line 1196, in <module>
    main()
  File "/usr/bin/git-review", line 1129, in main
    list_reviews(remote)
  File "/usr/bin/git-review", line 697, in list_reviews
    len(review_info[REVIEW_FIELDS[i]])
TypeError: object of type 'int' has no len()

The reason is a missing string conversion in the list_reviews function:

diff --git a/usr/bin/git-review b/git-review
index 1790ff7..0e0b0b7 100755
--- a/usr/bin/git-review
+++ b/git-review
@@ -694,7 +694,7 @@ def list_reviews(remote):
         for i in FIELDS:
             review_field_width[i] = max(
                 review_field_width[i],
- len(review_info[REVIEW_FIELDS[i]])
+ len(str(review_info[REVIEW_FIELDS[i]]))
             )

     review_field_format = " ".join([

$ lsb_release -rd
Description: Ubuntu 14.04.5 LTS
Release: 14.04

$ apt-cache policy git-review
git-review:
  Installed: 1.23-1
  Candidate: 1.23-1
  Version table:
 *** 1.23-1 0
        500 http://some.local.mirror/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

Tags: patch trusty
tags: added: patch trusty
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in git-review (Ubuntu):
status: New → Confirmed
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.