Message3651

Author rnk
Recipients bupjae, rnk
Date 2008-10-10.22:32:39
SpamBayes Score 5.9184157e-07
Marked as misclassified No
Message-id <1223677960.66.0.411167265787.issue1146@psf.upfronthosting.co.za>
In-reply-to
Content
The problem was that PyDictionary was checking if the argument it was
passed had a 'keys' method and then calling it and iterating them. 
Hashtable has a keys method, but HashMap and the Map interface have a
'keySet' method.  If a keys method doesn't exist, PyDictionary iterates
the argument for key-value pairs.  However, iterating HashMap produces
the keys, not the key-value pairs.  Since strings in python are iterable
and support __len__, PyDictionary was complaining that it wasn't the
right length, ie a pair.

I've attached a patch to check if the object supports the keySet method,
and use that instead of the keys method.  I also added a bugtest.
History
Date User Action Args
2008-10-10 22:32:40rnksetmessageid: <1223677960.66.0.411167265787.issue1146@psf.upfronthosting.co.za>
2008-10-10 22:32:40rnksetrecipients: + rnk, bupjae
2008-10-10 22:32:40rnklinkissue1146 messages
2008-10-10 22:32:40rnkcreate