Edgewall Software

Ticket #2779 (closed defect: fixed)

Opened 3 years ago

Last modified 3 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:

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

Changed 3 years ago by tobixx@…

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

Changed 3 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.

Changed 3 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

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

Changed 3 years ago by cboos

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

Add/Change #2779 ([workflow] MiniFieldStorage instance has no attribute 'strip')

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.