#2779 closed defect (fixed)
[workflow] MiniFieldStorage instance has no attribute 'strip'
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | wsgi |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Hello,
in the workflow sandbox there are several bugs where string functions are called one MiniFieldStorage types. It seems that the wrong type (MiniFieldStorage) comes in where strings are expected. One sample: when i try to open a new ticket a got the following error:
Traceback (most recent call last):
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/web/standalone.py", line 282, in _do_trac_req
dispatch_request(path_info, req, env)
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/web/main.py", line 142, in dispatch_request
dispatcher.dispatch(req)
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/web/main.py", line 110, in dispatch
resp = chosen_handler.process_request(req)
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 122, in process_request
ticket.populate(req.args)
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/ticket/model.py", line 125, in populate
self[name] = values.get(name, '')
File "/devel/eapsh/local/lib/python2.4/site-packages/trac/ticket/model.py", line 118, in __setitem__
value = value.strip()
AttributeError: MiniFieldStorage instance has no attribute 'strip'
Greetings Steffen Oschatz
Attachments (0)
Change History (4)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
| Keywords: | wsgi added |
|---|---|
| Priority: | high → low |
| Severity: | blocker → normal |
| Summary: | MiniFieldStorage instance has no attribute 'strip' → [workflow] MiniFieldStorage instance has no attribute 'strip' |
This stuff is going to be fixed once the WSGI branch is merged and the workflow branch updated accordingly.
The workflow system is an experimental branch, so setting it to high priority and blocker is inappropriate.
comment:3 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
WSGI branch has been fixed in [2957], so this is fixed.
comment:4 by , 20 years ago
(actually this will be fixed once the WorkFlow branch syncs with the current trunk)



I don't know anything about your design or trac itself (just know it since yesterday), but i have fixed the bug for myself with:
def populate(self, values): """Populate the ticket with 'suitable' values from a dictionary""" field_names = [f['name'] for f in self.fields] for name in [name for name in values.keys() if name in field_names]: value= values.get(name, '') if isinstance(value, str): self[name] = value else: try : self[name] = value.value except: raise TypeError, 'Unexpected type for population: %s' % type(value)This is an ugly hack - but works for me. I leave the status of this ticket as it is, because I'm pretty sure that you know the right place where to fix it in an better way.
Greetings Steffen Oschatz