Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#6833 closed task (fixed)

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

Reported by: PontusCarlsson@… Owned by: Robert Verspuy
Priority: high Component: PhpdocPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.11

Description

html_output = Option('phpdoc', 'html_output', None, at line 50 should be: html_output = Option('phpdoc', 'html_output', , instead

If [phpdoc] html_output = isn't set then the plugin will fail with the error message "AttributeError: 'NoneType' object has no attribute 'startswith'" because of that process_request on line 159 tries to access a String method on a NoneType.

Attachments (0)

Change History (10)

comment:1 in reply to:  description Changed 15 years ago by mathdesc@…

Priority: normalhigh
Severity: normalcritical

Replying to PontusCarlsson@live.se:

html_output = Option('phpdoc', 'html_output', None, at line 50 should be: html_output = Option('phpdoc', 'html_output', , instead

If [phpdoc] html_output = isn't set then the plugin will fail with the error message "AttributeError: 'NoneType' object has no attribute 'startswith'" because of that process_request on line 159 tries to access a String method on a NoneType.

Is the "should be" statement above a valid resolution to this ? My trac.log says :

 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.7-py2.4.egg/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.7-py2.4.egg/trac/web/main.py", line 206, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/phpdoctrac/phpdoctrac.py", line 159, in process_request
  File "/usr/lib64/python2.4/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

As yours I guess and indeed that's line 159. I am not familiar with python's egg : did you try out to patch the line and make it work ?

If not and as I'm not able to fix this : is there a way to deactivate a piece of the functionality to make PHPDoc work ?

Mathdesc

comment:2 Changed 15 years ago by PontusCarlsson@…

Yes, my "Should be" patch works flawless. I've been using this egg stable since I've posted this patch and everything works.

If maybe the author of this plugin could look over here could perhaps commit an updated version of the code.

comment:3 Changed 15 years ago by mathdesc@…

Sure exarv should read this thread !

Meanwhile it happens, may I ask you how you did patch the original egg or if you could attach your patched egg ? I did find litterature on how to cook eggs from source, but can't find anything for "the other way round"...

Tack bra!

comment:4 in reply to:  3 Changed 15 years ago by anonymous

Type: defecttask

Replying to mathdesc@scourge.biz:

Sure exarv should read this thread !

Meanwhile it happens, may I ask you how you did patch the original egg or if you could attach your patched egg ? I did find litterature on how to cook eggs from source, but can't find anything for "the other way round"...

Tack bra!

Self-reply :) 0.svn co http://trac-hacks.org/svn/phpdocplugin/0.11/ 1.edit & correct phpdoctrac.py 2.python setup.py bdist_egg 3.copy where to...

Testing in production tomorrow.

comment:5 Changed 15 years ago by Robert Verspuy

Yes, I'm reading it. But very busy at work at the last weeks, euh. months. I'l try to apply the patch tomorrow and post the new version into svn

comment:6 Changed 15 years ago by Robert Verspuy

Status: newassigned

comment:7 Changed 15 years ago by PontusCarlsson@…

Yes, that's the way to do it. Thanks exarv :)

comment:8 Changed 15 years ago by Robert Verspuy

(In [7799]) re #6833 - Changed None to an empty string

comment:9 Changed 15 years ago by Robert Verspuy

Resolution: fixed
Status: assignedclosed

Requested change implemented

comment:10 in reply to:  9 Changed 15 years ago by anonymous

Replying to exarv:

Requested change implemented

Be thanked, exarv, this hack is very handy. (BTW I've add the easy_install way to installation instructions.)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Verspuy.
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.