When using python 3, get "too many values to unpack" error

Bug #1359880 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Louis Taylor

Bug Description

With devstack/py27 environment:

 $ ./.tox/py27/bin/glance --os-image-url http://localhost:9292 image-list
 +--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
 | ID | Name | Disk Format | Container Format | Size | Status |
 +--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
 | b9a6d072-7e47-4821-8dd9-d61d9dfa8ca7 | cirros-0.3.2-x86_64-uec | ami | ami | 25165824 | active |
 | 6ada155d-a9a1-46eb-8518-72f55927a629 | cirros-0.3.2-x86_64-uec-kernel | aki | aki | 4969360 | active |
 | b621fed3-e9d1-4378-b538-cfab84cc38aa | cirros-0.3.2-x86_64-uec-ramdisk | ari | ari | 3723817 | active |
 | 9e24be91-5a53-4794-92f1-16ae2ac252ec | Fedora-x86_64-20-20140618-sda | qcow2 | bare | 209649664 | active |

with py33:

$ ./.tox/py33/bin/glance --os-image-url http://localhost:9292 image-list
too many values to unpack (expected 2)

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Note that the swift client (which also uses requests) works ok with python 3:

$ ./.tox/py33/bin/swift stat

      Account: 1234
   Containers: 8
      Objects: 23
        Bytes: 325
 Content-Type: text/plain; charset=utf-8
  X-Timestamp: 131.5

Louis Taylor (kragniz)
Changed in python-glanceclient:
assignee: nobody → Louis Taylor (kragniz)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/116987

Changed in python-glanceclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/116987
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=6dda6f306f44f68c437176428eb041d4fd862505
Submitter: Jenkins
Branch: master

commit 6dda6f306f44f68c437176428eb041d4fd862505
Author: Louis Taylor <email address hidden>
Date: Tue Aug 26 18:21:47 2014 +0000

    Fix error when logging http response with python 3

    Python 3 changed the semantics of dict.items() [0], which now returns a
    iterable 'view' instead of a list of tuples. This has the repercussion
    that you can no longer check for membership of a key using:

        key in dict.items()

    This patch simply replaces that check with a test for the key existing
    in the dict itself, rather than the items.

    [0] http://legacy.python.org/dev/peps/pep-3106/

    Closes-Bug: 1359880

    Change-Id: I7c59b0432725b660c9fa7270cde2e07bf3ea77db

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → 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.