TypeError when passing list to itemswidget

Bug #98491 reported by Francis J. Lacoste
12
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned
Zope 3
Won't Fix
Medium
Unassigned
zope.formlib
Fix Released
Medium
Tres Seaver

Bug Description

When an itemswidget inheriting from SingleDataHelper (like SelectWidget or RadioWidget) receives a list from the request, it fails with a TypeError.

The widget will receive a list instead of a string with handcrafted URLs like: form?field.radio=1&field.radio=1. This can also happen with self-posting forms: some buggy browsers will interpret action="" as including the previous query parameters and will append the new parameters to the old ones, resulting in such a URL being accessed.

I think it would be better if TypeError would be caught and transformed into the appropriate ConversionError.

I'm attaching a patch with test.

Recently: OOPS-981G1766, OOPS-981H1776
TypeError: list objects are unhashable

Revision history for this message
Francis J. Lacoste (flacoste) wrote : TypeError when passing list to
Changed in launchpad:
assignee: nobody → flacoste
importance: Undecided → High
status: Unconfirmed → In Progress
Revision history for this message
Christian Theune (ctheune) wrote :

Can somebody who is more certain about zope.app.form can review this patch?

Changed in zope3:
status: New → Confirmed
Changed in launchpad:
importance: High → Low
Ursula Junque (ursinha)
description: updated
Curtis Hovey (sinzui)
Changed in launchpad-foundations:
status: In Progress → Triaged
assignee: Francis J. Lacoste (flacoste) → nobody
Tres Seaver (tseaver)
Changed in zope.formlib:
status: New → Confirmed
importance: Undecided → Medium
Changed in zope3:
status: Confirmed → Won't Fix
Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks very much for the patch. Now committed to zope.formlib trunk, for the 4.0.3 release:

  http://svn.zope.org/zope.formlib/trunk/?rev=110933&view=rev

Changed in zope.formlib:
assignee: nobody → Tres Seaver (tseaver)
status: Confirmed → Fix Committed
Tres Seaver (tseaver)
tags: added: bugday20100424
Revision history for this message
Tres Seaver (tseaver) wrote :

Fix released with zope.formlib 4.0.3:

 http://pypi.python.org/pypi/zope.formlib/4.0.3

Changed in zope.formlib:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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