Apache Mod-Python - Created: (MODPYTHON-239) StringField comparisons ignore

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > July 2007 > Created: (MODPYTHON-239) StringField comparisons ignore





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Created: (MODPYTHON-239) StringField comparisons ignore
Bobby Schaetzle (JIRA)

2007-07-17, 7:12 pm

StringField comparisons ignore field name
-----------------------------------------

Key: MODPYTHON-239
URL: https://issues.apache.org/jira/browse/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)

outputs:

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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com