StringField comparisons ignore field name

                 Key: MODPYTHON-239
             Project: mod_python
          Issue Type: Bug
    Affects Versions: 3.3.1
            Reporter: Bobby Schaetzle

Comparisons between StringField instances fall back on the default str 
comparator.  This means that two StringField objects with the same value will 
compare as equal, even if they represent two different form fields.  This 
manifests itself most obviously when trying to delete items by key from the 
FieldStorage table:

    import mod_python
    form = mod_python.util.FieldStorage(req)
    form.add_field("foo", "bogleg")
    form.add_field("bar", "bogleg")
    print "before=" + repr(form.list)
    del form["bar"]
    print "after=" + repr(form.list)


    before=[Field('foo', 'bogleg'), Field('bar', 'bogleg')]
    after=[Field('bar', 'bogleg')]

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to