Sort error on dict_keys with python 3

Bug #1217513 reported by Matt Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raise
Fix Released
Critical
Unassigned

Bug Description

Running an example with python 3 gives an error:
python3 raise

Traceback (most recent call last):
  File "raise_actual", line 1116, in <module>
    keys.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

Revision history for this message
Matt Jones (workhorsy) wrote :

This is because in Python 3 getting the keys() of a Dict returns a dict_keys object instead of a list. Change this:

targets.keys()

to this:

list(targets.keys())

Revision history for this message
Matt Jones (workhorsy) wrote :
Changed in raise:
status: Confirmed → Fix Committed
Matt Jones (workhorsy)
Changed in raise:
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.