Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#11538 closed defect (fixed)

Unexpected keyword argument to TracError.__init__

Reported by: rjollos Owned by: osimons
Priority: normal Component: CustomFieldAdminPlugin
Severity: normal Keywords:
Cc: Trac Release:


I've been reviewing the code for possible inclusion in the Trac core, and spotted the following issue:

  • customfieldadminplugin/0.11/customfieldadmin/

    diff --git a/customfieldadminplugin/0.11/customfieldadmin/ b/customfieldad
    index 7a263b5..03f2de9 100644
    a b class CustomFields(Component): 
    106106        # Check that it is a valid field type 
    107107        if not cfield['type'] in \ 
    108108                        ['text', 'checkbox', 'select', 'radio', 'textarea']: 
    109             raise TracError(_("%(field_type)s is not a valid field type"), 
    110                                         field_type=cfield['type']) 
     109            raise TracError(_("%(field_type)s is not a valid field type", 
     110                              field_type=cfield['type'])) 
    111111        # Check that field does not already exist 
    112112        # (if modify it should already be deleted) 
    113113        if create and self.config.get('ticket-custom', cfield['name']): 

It's unlikely to cause any issues as far as I can see since there are other checks in place, but if the TracError was raised, the following traceback would result:

Traceback (most recent call last):
  File "/home/user/Workspace/th11536/teo-rjollos.git/trac/web/", line 506, in _dispatch_request
  File "/home/user/Workspace/th11536/teo-rjollos.git/trac/web/", line 221, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/user/Workspace/th11536/teo-rjollos.git/trac/admin/", line 125, in process_request
  File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/", line 87, in render_admin_panel
    cf_api.update_custom_field(cfield, create=True)
  File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/", line 158, in update_custom_field
  File "/home/user/Workspace/trachacks.git/customfieldadminplugin/0.11/customfieldadmin/", line 110, in verify_custom_field
TypeError: __init__() got an unexpected keyword argument 'field_type'

Attachments (0)

Change History (2)

comment:1 Changed 6 months ago by osimons

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

In 13638:

CustomFieldAdminPlugin: Typo in i18n error message call. Closes #11538.

Well spotted, rjollos ;-)

comment:2 in reply to: ↑ description Changed 6 months ago by rjollos

Replying to rjollos:

I've been reviewing the code for possible inclusion in the Trac core, ...

I think this can be done in 20-30 hours effort, so I'm going to push it for milestone:1.1.3: trac:#11469.

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.