Modify

Opened 14 years ago

Closed 8 years ago

Last modified 8 years ago

#7247 closed defect (fixed)

Trac 0.11.6 AttributeError: 'NoneType' object has no attribute 'startswith'

Reported by: Sam Owned by: Committo-Ergo-Sum
Priority: normal Component: DoxygenPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

Environment

Trac:  	0.11.6
Python: 	2.4.3 (#1, Jun 11 2009, 14:09:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
setuptools: 	0.6c9
SQLite: 	3.3.6
pysqlite: 	2.5.1
Genshi: 	0.5.1
mod_python: 	3.2.8
Subversion: 	1.6.6 (r40053)
jQuery:	1.2.6
Error:
 Trac detected an internal error:

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


Python Traceback
Most recent call last:

    * File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 450, in _dispatch_request
      Code fragment:
       445. try:
       446. if not env and env_error:
       447. raise HTTPInternalError(env_error)
       448. try:
       449. dispatcher = RequestDispatcher(env)
       450. dispatcher.dispatch(req)
       451. except RequestDone:
       452. pass
       453. resp = req._response or []
       454.  
       455. except HTTPException, e:
      Local variables:
      Name	Value
      after 	[u' except RequestDone:', u' pass', u' resp = ...
      before 	[u' try:', u' if not env and env_error:', u' raise ...
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x2ae2397c3d50>
      e 	<exceptions.AttributeError instance at 0x2aaaacb15d88>
      env 	<trac.env.Environment object at 0x2ae2397b1210>
      env_error 	None
      exc_info 	(<class exceptions.AttributeError at 0x2ae23030c6b0>, ...
      filename 	'/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py'
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	449
      message 	u"AttributeError: 'NoneType' object has no attribute 'startswith'"
      req 	<Request "GET u'/doxygen/'">
      resp 	[]
      tb 	<traceback object at 0x2aaaacb15dd0>
      tb_hide 	None
      traceback 	u'Traceback (most recent call last):\n File ...
    * File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/web/main.py", line 206, in dispatch
      Code fragment:
       201. req.args.get('__FORM_TOKEN') != req.form_token:
       202. raise HTTPBadRequest('Missing or invalid form token. '
       203. 'Do you have cookies enabled?')
       204.  
       205. # Process the request and render the template
       206. resp = chosen_handler.process_request(req)
       207. if resp:
       208. if len(resp) == 2: # Clearsilver
       209. chrome.populate_hdf(req)
       210. template, content_type = \
       211. self._post_process_request(req, *resp)
      Local variables:
      Name	Value
      chosen_handler 	<doxygentrac.doxygentrac.DoxygenPlugin object at 0x2ae2397ce050>
      chrome 	<trac.web.chrome.Chrome object at 0x2ae2397c3650>
      err 	(<class exceptions.AttributeError at 0x2ae23030c6b0>, ...
      handler 	<doxygentrac.doxygentrac.DoxygenPlugin object at 0x2ae2397ce050>
      req 	<Request "GET u'/doxygen/'">
      self 	<trac.web.main.RequestDispatcher object at 0x2ae2397c3d50>
    * File "build/bdist.linux-x86_64/egg/doxygentrac/doxygentrac.py", line 159, in process_request
      Local variables:
      Name	Value
      action 	'index'
      link 	None
      path 	''
      req 	<Request "GET u'/doxygen/'">
      self 	<doxygentrac.doxygentrac.DoxygenPlugin object at 0x2ae2397ce050>
      wiki 	None
    * File "/usr/lib64/python2.4/posixpath.py", line 60, in join 

Attachments (0)

Change History (15)

comment:1 Changed 14 years ago by anonymous

same here !!!

comment:2 Changed 14 years ago by Alexander Dahl

Same here on Debian Lenny with trac 0.11.7 from backports 1 and r9251 from svn.

File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 450, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 206, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-i686/egg/doxygentrac/doxygentrac.py", line 159, in process_requestFile "/usr/lib/python2.5/posixpath.py", line 60, in join
  if b.startswith('/'):
System Information:

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Trac:           0.11.7
Python:         2.5.2 (r252:60911, Jan 24 2010, 14:53:14) [GCC 4.3.2]
setuptools:     0.6c8
SQLite:         3.5.9
pysqlite:       2.4.1
Genshi:         0.5.1
Pygments:       0.10
Mercurial:      1.3.1
jQuery:         1.2.6

comment:3 Changed 13 years ago by macjoost@…

Trac Release: 0.110.12

Same for Trac 0.12

I think I found the solution ("works for me")

The 'html_output' option for DoxygenPlugin defaults to None in doxygentrac.py line 50. I changed that to '' (empty string) and everything worked again!

comment:4 Changed 13 years ago by Alexander Dahl

This fix works for me too with Debian Squeeze (stable) and Doxygen Plugin r9996 doxygenplugin/0.11.

comment:5 Changed 13 years ago by Ryan J Ollos

Description: modified (diff)

comment:6 in reply to:  3 Changed 13 years ago by anonymous

Replying to macjoost@gmail.com:

Same for Trac 0.12

I think I found the solution ("works for me")

The 'html_output' option for DoxygenPlugin defaults to None in doxygentrac.py line 50. I changed that to '' (empty string) and everything worked again!

Empty string didn't for me, but . did work.

comment:7 Changed 13 years ago by anonymous

Setting html_output = html in trac.ini worked for me in 0.12.

comment:8 Changed 12 years ago by Ryan J Ollos

Trac Release: 0.120.11

comment:9 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [12233]) Fixes #7247: Changed the default value for html_output to be an empty string.

comment:10 Changed 12 years ago by Ryan J Ollos

What I'm seeing in Trac 0.11 and later is that an empty string is returned from an Option object even when its default value is None. However, the change seemed harmless enough, so I went ahead and applied it.

comment:11 Changed 11 years ago by olaf.meeuwissen@…

The empty string didn't work for me, had to use a . to get things to work.

comment:12 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: closedreopened

I'll take another look. What version of Trac are you running? Could you paste your [doxygen] section of trac.ini into this ticket? Thanks.

comment:13 Changed 11 years ago by anonymous

Running Trac-0.12.5 + a pile of plugins under Python 2.6. The [doxygen] section looks as follows:

[doxygen]
encoding = utf-8
ext = html png css
html_output = .
index = index.html
path = /srv/projects/project-name/trac/cache/doxygen/trunk/html
source_ext = cpp hpp ipp dox
title = Documentation

The path may need some explanation. If I use the html bit as html_output, the links in index.html lead to the Trac search for some reason. The documentation uses a somewhat unusual layout where we have several subdirectories with output of doxygen targetting different user groups. The top-level index.html points to the index.html of the various subdirectories. That looks a bit like so

doxygen/trunk/html/
doxygen/trunk/html/index.html
doxygen/trunk/html/api-specs/
doxygen/trunk/html/api-specs/index.html
doxygen/trunk/html/usr-guide/
doxygen/trunk/html/usr-guide/index.html

and so on.

comment:14 Changed 8 years ago by Committo-Ergo-Sum

Resolution: fixed
Status: reopenedclosed

Fixed in version > 0.11.

comment:15 Changed 8 years ago by Ryan J Ollos

Owner: changed from Christian Boos to Committo-Ergo-Sum

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Committo-Ergo-Sum.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.