Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2779 closed defect (fixed)

[workflow] MiniFieldStorage instance has no attribute 'strip'

Reported by: tobixx@… 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 tobixx@…, 18 years ago

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

comment:2 by Christopher Lenz, 18 years ago

Keywords: wsgi added
Priority: highlow
Severity: blockernormal
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 Christopher Lenz, 18 years ago

Resolution: fixed
Status: newclosed

WSGI branch has been fixed in [2957], so this is fixed.

comment:4 by Christian Boos, 18 years ago

(actually this will be fixed once the WorkFlow branch syncs with the current trunk)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.