Opened 8 years ago

Closed 8 years ago

# TypeError: not enough arguments for format string

Reported by: Owned by: carlones coling high ClientsPlugin blocker 0.11

### Description

Hi,

Im using trac 0.11 and when I add a Client this error occurs, im using sqlite database.

Another thing: How can i add addicional fields to an client, I wanna add an ID, to refer the client in another software.

Thanks, Carlos

#### How to Reproduce

While doing a POST operation on /admin/ticket/clients, Trac issued an internal error.

Request parameters:

{'__FORM_TOKEN': u'04b33903abee07182a0d3e38',
'cat_id': u'ticket',
'name': u'1',
'panel_id': u'clients',
'path_info': None}


User Agent was: Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3

#### System Information

 Trac 0.11.1 Python 2.5.2 (r252:60911, Jul 31 2008, 17:49:46) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] setuptools 0.6c8 SQLite 3.4.2 pysqlite 2.4.0 Genshi 0.6dev-r960 mod_python 3.3.1 Subversion 1.4.6 (r28521) jQuery: 1.2.6

#### Python Traceback

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 197, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/admin/web_ui.py", line 113, in process_request
path_info)
return self._render_admin_panel(req, cat, page, version)
clnt.insert()
File "build/bdist.linux-x86_64/egg/clients/model.py", line 80, in insert
self.default_rate, self.currency))
File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/sqlite_backend.py", line 56, in execute
sql = sql % (('?',) * len(args))
TypeError: not enough arguments for format string



### comment:1 follow-up: ↓ 2 Changed 8 years ago by coling

• Status changed from new to assigned

I actually fixed this just this morning :) See #3948 and [4560].

As for adding a new field there is no way to do this just now but adding a reference or external id seems like a fairly generic thing so I'll add it to the standard fields.

That said depending on how you want to integrate the client with this external system, it may be more appropriate to define an "action" which then allows you to put in per-client data specific to that action.... I'd guess that this doesn't apply to your needs tho'.

### comment:2 in reply to: ↑ 1 Changed 8 years ago by carlones

I actually fixed this just this morning :) See #3948 and [4560].

As for adding a new field there is no way to do this just now but adding a reference or external id seems like a fairly generic thing so I'll add it to the standard fields.

That said depending on how you want to integrate the client with this external system, it may be more appropriate to define an "action" which then allows you to put in per-client data specific to that action.... I'd guess that this doesn't apply to your needs tho'.

Thanks for your help!

### comment:3 Changed 8 years ago by coling

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

See #3974 for the adding of an external client id tracking. Not sure when I'll get round to this but there is no point in keeping this bug open (I have too many of those!!!) to track it, especially when the main subject of the bug has been fixed :)