Opened 13 years ago

Closed 13 years ago

#4992 closed bug (fixed)

AttributeError: 'NoneType' object has no attribute 'split'

Reported by: idefix Owned by: nielx
Priority: normal Milestone: R1
Component: Website/Trac Version: R1/alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All


How to Reproduce

While doing a POST operation on /ticket/4749, Trac issued an internal error.

(please provide additional details here)
Happened after clicking the preview button of a new comment to ticket:4749.

Request parameters:

{'__FORM_TOKEN': u'6044a29f84524bb197bc23a9',
 'action': u'leave',
 'cnum': u'3',
 'comment': u'Changing the recognition rule of `text/x-patch` to:\r\n{{{\r\n0.30          ([0:100]"Index: " | [0:100]"--- " | [0:100]"+++ " | [0:100]"@@ -")\r\n}}}\r\nGets it correctly recognized as a patch file.',
 'field_blockedby': u'',
 'field_blocking': u'',
 'field_component': u'Servers/registrar',
 'field_keywords': u'',
 'field_milestone': u'R1',
 'field_platform': u'All',
 'field_priority': u'normal',
 'field_summary': u'Patch file-type not recognized',
 'field_type': u'bug',
 'field_version': u'R1/alpha1',
 'id': u'4749',
 'preview': u'Preview',
 'replyto': u'',
 'ts': u'2009-10-08 20:07:27+00:00'}

User Agent was: Mozilla/5.0 (BeOS; U; Haiku BePC; en-US; rv: Gecko/20090908 BeZillaBrowser/

System Information

Trac 0.11.5
Python 2.6 (r26:66714, Feb 3 2009, 20:52:03)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]]
setuptools 0.6c8
psycopg2 2.0.12
Genshi 0.5.1
mod_wsgi 2.5
Pygments 1.1.1
Subversion 1.6.3 (r38063)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/", line 444, in _dispatch_request
  File "/usr/lib/python2.6/site-packages/trac/web/", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.6/site-packages/trac/ticket/", line 182, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.6/site-packages/trac/ticket/", line 531, in _process_ticket_request
    get_reporter_id(req, 'author'), field_changes)
  File "/usr/lib/python2.6/site-packages/trac/ticket/", line 1260, in _insert_ticket_data
    self._render_property_changes(req, ticket, field_changes)
  File "/usr/lib/python2.6/site-packages/trac/ticket/", line 1310, in _render_property_changes
  File "/usr/lib/python2.6/site-packages/trac/ticket/", line 1344, in _render_property_diff
    old_list, new_list = old.split(), new.split()
AttributeError: 'NoneType' object has no attribute 'split'

Change History (3)

in reply to:  description comment:1 by idefix, 13 years ago

Replying to idefix:

Happened after clicking the preview button of a new comment to ticket:4749.

Clicking the Submit changes button does not result in an error. And the Preview button of this comment also works correctly. Maybe there's something special with that ticket?

comment:2 by nielx, 13 years ago

Owner: changed from haiku-web to nielx
Status: newassigned

I have an idea what the problem could be. It has to do with the fact that the 'keywords' field is now enabled. I suspect that all tickets last updated from before the migration to the new server have a value of NULL in the database, whereas it will now receive an empty string if there are no values.

Trac expects a string. String types have the split() method, which the NoneType (=NULL) does not have.

Will go to the database now.

comment:3 by nielx, 13 years ago

Resolution: fixed
Status: assignedclosed

Should be fixed now:

UPDATE ticket SET keywords='' WHERE keywords IS NULL;
Note: See TracTickets for help on using tickets.