Modify

Opened 5 years ago

Closed 16 months ago

#6249 closed defect (fixed)

[Patch] Empty group file throws error

Reported by: anonymous Owned by: rjollos
Priority: normal Component: HtGroupEditorPlugin
Severity: normal Keywords:
Cc: r.rossmair@… Trac Release: 0.12

Description

If the group file is empty the following error is thrown

Trac detected an internal error:
AttributeError: 'NoneType' object has no attribute 'keys'

Most recent call last:
File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 444, in _dispatch_request
File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 205, in dispatch
File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/admin/web_ui.py", line 114, in process_request
File "build/bdist.linux-x86_64/egg/htgroupeditor/htgroupeditor.py", line 145, in render_admin_panel

It should just bring up the default screen with no selectable groups.

Attachments (1)

6249.patch (933 bytes) - added by wallento 5 years ago.
Proposed patch to this ticket

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by anonymous

  • Cc r.rossmair@… added
  • Trac Release changed from 0.11 to 0.12

comment:2 Changed 5 years ago by r.rossmair@…

  • Trac Release changed from 0.12 to 0.11

Same here, for 0.12multirepos-r8877

comment:3 follow-up: Changed 5 years ago by wallento

Attached you find a patch to this.

The list is created from the file. In the POST case, that can only happen when the GET was taken before, the list cannot be empty; otherwise no POST is possible (correct?).

In the other cases (GET), the list is checked to be empty. If so, just the empty entry is added. In other cases the groups are listed as usual.

Please review it before testing.

HTH,
Stefan

comment:4 Changed 5 years ago by anonymous

  • Trac Release changed from 0.11 to 0.12

Changed 5 years ago by wallento

Proposed patch to this ticket

comment:5 Changed 5 years ago by wallento

The previous patch had an error in using append(...) instead of concattenation. Sorry..

comment:6 Changed 16 months ago by rjollos

#8408 closed as a duplicate.

comment:7 Changed 16 months ago by rjollos

  • Summary changed from Empty group file throws error to [Patch] Empty group file throws error

comment:8 in reply to: ↑ 3 Changed 16 months ago by rjollos

  • Owner changed from robert_martin to rjollos
  • Status changed from new to assigned

Replying to wallento:

Attached you find a patch to this.

Patch looks great. Sorry it took so long for us to get this applied!

comment:9 Changed 16 months ago by rjollos

(In [13122]) Refs #6249: Avoid traceback when the htgroups file is empty. Patch by wallento.

comment:10 Changed 16 months ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.