Modify ↓
Opened 5 years ago
Closed 4 years ago
#13228 closed defect (fixed)
DataError: invalid input syntax for integer: "14XXX"
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.20 |
Component: | query system | Version: | 1.0.19 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix errors when report argument of query view is invalid. |
||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
DataError
exception is raised when invalid integer is given to report
parameter of /query
on PostgreSQL: /query?report=XXX
.
Also, UnicodeEncodeError
is raised when existent report number with unicode string is given to report
parameter on MySQL: /query?report=42ééé
.
Request parameters:
{u'col': [u'id', u'summary', u'status', u'type', u'priority', u'milestone', u'component'], u'order': u'priority', u'report': u'14XXX', u'status': [u'accepted', u'assigned', u'new', u'reopened']}
Python Traceback
Traceback (most recent call last): File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/web/main.py", line 567, in _dispatch_request dispatcher.dispatch(req) File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/web/main.py", line 249, in dispatch resp = chosen_handler.process_request(req) File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/ticket/query.py", line 1017, in process_request return self.display_html(req, query) File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/ticket/query.py", line 1155, in display_html """, (query.id,)): File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/db/api.py", line 124, in execute return db.execute(query, params) File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/db/util.py", line 128, in execute cursor.execute(query, params if params is not None else []) File "/venv/trac/1.0.19/lib/python2.5/site-packages/trac/db/util.py", line 61, in execute r = self.cursor.execute(sql_escape_percent(sql), args) DataError: invalid input syntax for integer: "14XXX" LINE 2: ... SELECT title, description FROM report WHERE id='14XXX' ^
Traceback (most recent call last): File "/venv/lib/python2.7/site-packages/trac/web/main.py", line 567, in _dispatch_request dispatcher.dispatch(req) File "/venv/lib/python2.7/site-packages/trac/web/main.py", line 249, in dispatch resp = chosen_handler.process_request(req) File "/venv/lib/python2.7/site-packages/trac/ticket/query.py", line 1004, in process_request return self.display_html(req, query) File "/venv/lib/python2.7/site-packages/trac/ticket/query.py", line 1142, in display_html """, (query.id,)): File "/venv/lib/python2.7/site-packages/trac/db/api.py", line 124, in execute return db.execute(query, params) File "/venv/lib/python2.7/site-packages/trac/db/util.py", line 128, in execute cursor.execute(query, params if params is not None else []) File "/venv/lib/python2.7/site-packages/trac/db/util.py", line 72, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 207, in execute if not self._defer_warnings: self._warning_check() File "/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 117, in _warning_check warn(w[-1], self.Warning, 3) File "/venv/lib64/python2.7/warnings.py", line 29, in _show_warning file.write(formatwarning(message, category, filename, lineno, line)) File "/venv/lib64/python2.7/warnings.py", line 38, in formatwarning s = "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message) UnicodeEncodeError: 'ascii' codec can't encode character u'\x81' in position 37: ordinal not in range(128)
Attachments (0)
Change History (2)
comment:1 by , 5 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 4 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [17409] and merged in [17410-17412].
Note:
See TracTickets
for help on using tickets.
Proposed changes: