Opened 17 years ago
Closed 17 years ago
#6702 closed defect (fixed)
TypeError: iteration over non-sequence
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | high | Milestone: | 0.11 |
Component: | ticket system | Version: | 0.11b1 |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /ticket/6
, Trac issued an internal error.
After implementing the vulnerability_tickets.py
plugin from source:trunk/sample-plugins/permissions I get the following error message when trying to submit a ticket.
Request parameters:
{'id': u'6'}
System Information
Trac | 0.11b1
|
Python | 2.4.4 (#1, Apr 5 2007, 20:09:06) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
|
setuptools | 0.6c3
|
SQLite | 2.8.17
|
pysqlite | 1.0.1
|
Genshi | 0.4.4
|
Pygments | 0.9
|
Subversion | 1.4.2 (r22196)
|
Python Traceback
Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/web/main.py", line 398, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/web/main.py", line 195, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/ticket/web_ui.py", line 159, in process_request return self._process_ticket_request(req) File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/ticket/web_ui.py", line 412, in _process_ticket_request req.perm('ticket', id, version).require('TICKET_VIEW') File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 538, in require if not self._has_permission(action, resource): File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 530, in _has_permission decision = PermissionSystem(self.env). \ File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 424, in check_permission perm) File "/home/trac/projects/test/plugins/vulnerability_tickets.py", line 45, in check_permission (resource.id,)): TypeError: iteration over non-sequence
Attachments (0)
Change History (10)
comment:1 by , 17 years ago
Component: | general → ticket system |
---|
comment:2 by , 17 years ago
Keywords: | permission added |
---|---|
Milestone: | → 0.11 |
Priority: | normal → high |
follow-up: 4 comment:3 by , 17 years ago
Keywords: | needinfo added |
---|---|
Priority: | high → normal |
SQLite: | 2.8.17
|
pysqlite: | 1.0.1
|
Wow. Trac 0.11 works with that! Very surprising.
Please upgrade to something more recent and try again…
comment:4 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Replying to cboos:
SQLite: 2.8.17
pysqlite: 1.0.1
Wow. Trac 0.11 works with that! Very surprising.
Please upgrade to something more recent and try again…
ups yes that was the reason…
It works now with PySqlite is version 2 (2.3.2), compiled and linked to use version SQLite 3.3.8. (on Debian Etch). Thank you for the quick reaction :)
follow-up: 6 comment:5 by , 17 years ago
Keywords: | documentation added; permission needinfo removed |
---|---|
Resolution: | invalid |
Severity: | normal → minor |
Status: | closed → reopened |
The documentation needs to be updated for 0.11: TracInstall#ForSQLite
It should be explicitly stated that SQLite 3.x is required.
Re-opening the ticket as a documentation reminder.
comment:6 by , 17 years ago
Replying to eblot:
Re-opening the ticket as a documentation reminder.
Maybe something as:
=== For SQLite === * [http://www.sqlite.org/ SQLite], version 3.3.4 and above preferred. * If not using Python-2.5: [http://pysqlite.org/ PySQLite], version 2.x (for SQLite 3.x), version 2.3.2 preferred. For details see PySqlite ''Note: PySQLite 2.x (SQLite 3.x) is required for Trac [milestone:0.11]. Do not use PySQLite 1.x (SQLite 2.x)''
BTW if PySQLite 1.x is known to cause issues, it might be useful to add this version dependency in the Trac backend code and maybe in the extras_require
section of setup.py
?
comment:8 by , 17 years ago
I think there are many places in the code where we expect to be able to iterate on an empty result set. But I agree that in this case, it's a bit weird that no results are given back (as the ticket exists). So it might be another bug at the SQLite / PySqlite 1 level.
Anyway, pysqlite 1.0.x is way old, and pysqlite2 is mature since years, so I don't think it's worth supporting 1.0.x for 0.11 anymore.
comment:9 by , 17 years ago
Priority: | normal → high |
---|
Interestingly I just had this issue myself, but with MySQL.
comment:10 by , 17 years ago
Keywords: | documentation removed |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
I just found out that the ticket is actually committed but the error occurs when trying to view the ticket or even the report view of the ticket.
I think this probably belongs to the ticket system