Ticket #2779 (closed defect: fixed)
Opened 6 years ago
Last modified 6 years ago
[workflow] MiniFieldStorage instance has no attribute 'strip'
| Reported by: | tobixx@… | Owned by: | jonas |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | wsgi |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 6 years ago by tobixx@…
comment:2 Changed 6 years ago by cmlenz
- Keywords wsgi added
- Priority changed from high to low
- Severity changed from blocker to normal
- Summary changed from MiniFieldStorage instance has no attribute 'strip' to [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 Changed 6 years ago by cmlenz
- Resolution set to fixed
- Status changed from new to closed
WSGI branch has been fixed in [2957], so this is fixed.
comment:4 Changed 6 years ago by cboos
(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