Opened 15 years ago

Closed 15 years ago

#20955 closed defect (fixed)

TypeError: sequence item 0: expected string, NoneType found

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: wsiegrist@…
Priority: Normal Milestone:
Component: server/hosting Version:
Keywords: Cc:
Port:

Description

How to Reproduce

While doing a POST operation on /ticketchangecomment/12429, Trac issued an internal error.

I was trying to change a comment I had just made in the ticket. I do this all the time in other tickets and have never seen this error before.

Request parameters:

{'__FORM_TOKEN': u'be4fae1649284d4d85f100f6',
 'author': u'ryandesign@macports.org',
 'comment': u'Replying to [comment:10 giorgio_v@\u2026]:\r\n> Is this bug still reproducible with the 1.8 release?\r\n\r\nYes. Take [attachment:Portfile this minimal portfile]:\r\n\r\n{{{\r\n$ port fetch\r\nMacPorts running without privileges. You may be unable to complete certain actions (eg install).\r\nPortfile changed since last build; discarding previous state.\r\n--->  Computing dependencies for foo\r\nMacPorts running without privileges. You may be unable to complete certain actions (eg install).\r\n--->  Fetching foo\r\nError: Target org.macports.fetch returned: /mp/var/macports/build/_private_tmp/work/{foo-1.0/Path with spaces}\r\nError: Status 1 encountered during processing.\r\n}}}\r\n\r\nThere should not be curly brackets around the worksrcdir in the message.',
 'href': u'/ticketchangecomment/12429',
 'href2': u'/ticket/12429#comment:11',
 'preview': u'Preview',
 'ticketid': u'12429',
 'time': u'1251716406'}

User Agent was: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9

System Information

Trac 0.11.4
Python 2.5.4 (r254:67916, Apr 1 2009, 14:14:53)
[GCC 4.0.1 (Apple Inc. build 5465)]
setuptools 0.6c9
psycopg2 2.0.5.1
Genshi 0.5
mod_python 3.3.1
Pygments 1.0
Subversion 1.6.4 (r38063)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/opt/local/lib/python2.5/site-packages/trac/web/main.py", line 435, in _dispatch_request
    dispatcher.dispatch(req)
  File "/opt/local/lib/python2.5/site-packages/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.macosx-10.5-i386/egg/ticketchange/web_ui.py", line 81, in process_request
    comment, self.env, req, db)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 1138, in wiki_to_html
    Formatter(env, context).format(wikitext, out, escape_newlines)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 874, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py", line 150, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 821, in replace
    replacement = self.handle_match(fullmatch)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 817, in handle_match
    return internal_handler(match, fullmatch)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 386, in _lhref_formatter
    return self._make_link(ns, target, match, label, fullmatch)
  File "/opt/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 393, in _make_link
    escape(label, False))
  File "/opt/local/lib/python2.5/site-packages/trac/attachment.py", line 727, in _format_link
    if attachment and 'ATTACHMENT_VIEW' in formatter.perm(attachment):
  File "/opt/local/lib/python2.5/site-packages/trac/perm.py", line 524, in has_permission
    return self._has_permission(action, resource)
  File "/opt/local/lib/python2.5/site-packages/trac/perm.py", line 538, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "/opt/local/lib/python2.5/site-packages/trac/perm.py", line 433, in check_permission
    (username, action, resource))
  File "/opt/local/lib/python2.5/site-packages/trac/resource.py", line 111, in __repr__
    return '<Resource %r>' % (', '.join(reversed(path)))
TypeError: sequence item 0: expected string, NoneType found

Change History (3)

comment:1 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

The problem only occurred when using Preview after making changes to the comment text. When I actually submitted the changes, they showed up fine.

comment:2 Changed 15 years ago by wsiegrist@…

Status: newassigned

This is fixed upstream in Trac 0.11.5. I'll be upgrading soon.

comment:3 Changed 15 years ago by wsiegrist@…

Resolution: fixed
Status: assignedclosed

We upgraded to v0.11.5. Please reopen or file a new ticket if this reoccurs.

Note: See TracTickets for help on using tickets.