#7092 closed defect (fixed)
AttributeError: 'list' object has no attribute 'strip'
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I just started using Trac, thanks to all who developed it.
After creating my first ticket I wanted to change the assignment but got the error listed below. Then I tried to set "Action: leave as new" but got the same error. I found some similar error reports that are 2 years old but I don't know whether they are really related or not, so I'm creating this report.
Python Traceback
Traceback (most recent call last): File "C:\Python24\lib\site-packages\trac\web\main.py", line 406, in dispatch_request dispatcher.dispatch(req) File "C:\Python24\lib\site-packages\trac\web\main.py", line 237, in dispatch resp = chosen_handler.process_request(req) File "C:\Python24\lib\site-packages\trac\ticket\web_ui.py", line 290, in process_request self._do_save(req, db, ticket) File "C:\Python24\lib\site-packages\trac\ticket\web_ui.py", line 517, in _do_save ticket.populate(req.args) File "C:\Python24\lib\site-packages\trac\ticket\model.py", line 124, in populate self[name] = values.get(name, '') File "C:\Python24\lib\site-packages\trac\ticket\model.py", line 117, in __setitem__ value = value.strip() AttributeError: 'list' object has no attribute 'strip'
Attachments (0)
Change History (11)
comment:1 by , 17 years ago
Component: | general → ticket system |
---|---|
Description: | modified (diff) |
Keywords: | needinfo added |
Owner: | changed from | to
comment:2 by , 17 years ago
Milestone: | → 0.11.1 |
---|
It's actually easy to reproduce: this is triggered when multiple values are specified for the same field, e.g. newticket. That's not how the original reporter triggered the issue (he was doing a POST) so it's not clear how that have happened for him (a plugin? local modifications to the template? more info on this still appreciated).
While we don't currently support multiple values for a field, that's more a limitation than a feature (see #918 and #4298, eventually also #2662 depending how we'll implement that).
But first, we should produce a nicer error than this internal.
comment:3 by , 17 years ago
I do:
klick "View Tickets" klick "Active Tickets" klick the first (and until now only) Ticket klick "Submit changes"
The version we are using is 0.10.4.
comment:4 by , 17 years ago
Do you have custom ticket fields, if yes, can you copy your [ticket-custom]
section from your trac.ini file here?
comment:5 by , 17 years ago
The ticket-custom section of our trac.ini file is as follows:
[ticket-custom] dependencies = text dependencies.label = Abh~ngigkeiten (Tickets) dependencies.order = 2 due_assign = text due_assign.label = Bis wann zu best~tigen due_assign.order = 1 due_assign.value = DD/MM/2008 due_close = text due_close.label = Bis wann zu erledigen due_close.order = 3 due_close.value = DD/MM/2008 include_gantt = checkbox include_gantt.label = In Gant anzeigen include_gantt.order = 4
comment:6 by , 17 years ago
Any chance you're using a plugin that would also use on of these fields? Check the sources of your plugins, and grep for 'dependencies', 'due_assign', etc.
comment:7 by , 17 years ago
There are plugins but I couldn't find any 'dependencies' or 'due_assign'. I put a write statement into model.py:
def __setitem__(self, name, value): """Log ticket modifications so the table ticket_change can be updated""" if self.values.has_key(name) and self.values[name] == value: return if not self._old.has_key(name): # Changed field self._old[name] = self.values.get(name) elif self._old[name] == value: # Change of field reverted del self._old[name] if value: aus = open('D:\\trac.log','a') aus.write('%s %s' % (name.__str__(), value.__str__())) aus.close() field = [field for field in self.fields if field['name'] == name] if field and field[0].get('type') != 'textarea': value = value.strip() self.values[name] = value
The following was written to trac.log:
component [u'component1', u'component1']
Does this help?
comment:8 by , 17 years ago
Well, yes a bit, as we now see that the field in question is 'component'
, not a custom field as I thought. So maybe there's a plugin which sets this? Or a local modification to the templates?
Something must be different on your system, as in a normal setup, the ticket forms won't set the 'component'
argument twice. You can check what the ticket page form contains with "View sources" in your browser, maybe that will give an hint.
comment:9 by , 17 years ago
Things are a little bit strange. Firefox shows the elements "Priority, "Milestone", "Component" and "Version" twice, although they only appear once in the page source. I didn't install Trac so I have to ask my colleague who did it. Thanks so far for your help.
comment:11 by , 17 years ago
Keywords: | needinfo removed |
---|---|
Milestone: | 0.11.1 → 0.11 |
Resolution: | → fixed |
Status: | new → closed |
Fixed in r7023.
Multi-valued fields support will be a topic for further data model improvements (TracDev/Proposals/DataModel).
When you submit a new ticket, please always specify the version of Trac you're using, and use verbatim blocks {{{ ... }}} to quote tracebacks. TIA.