#3027 closed defect (fixed)
Ticket update broken
Reported by: | Owned by: | Alec Thomas | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | general | Version: | devel |
Severity: | minor | Keywords: | workflow |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If a ticket has a subject but not a description any update to that ticket will cause a crash"
Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 300, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 176, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 188, in process_request self._insert_ticket_data(req, db, ticket, reporter_id, fields) File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 451, in _insert_ticket_data similar = ticket_system.find_duplicates(ticket) File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 457, in find_duplicates summ_cmp = Similarity(ticket['summary']) File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 557, in __init__ self.hashed = self._hash_text(text) File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 571, in _hash_text return set([(len(x), hash(x)) for x in words]) NameError: global name 'set' is not defined
Version
sandbox/workflow (0.10dev) from april-11-2006
Attachments (0)
Change History (6)
comment:1 by , 19 years ago
Keywords: | workflow added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 19 years ago
Or better, use trac.util.set
which already does the above:
-
api.py
21 21 from trac.perm import IPermissionRequestor 22 22 from trac.Search import ISearchSource, search_to_sql, shorten_result 23 23 from trac.ticket.field import * 24 from trac.util import shorten_line, to_list, to_bool 24 from trac.util import shorten_line, to_list, to_bool, set 25 25 from trac.util.markup import html, Markup 26 26 from trac.wiki import IWikiSyntaxProvider, Formatter
comment:3 by , 19 years ago
Ah, good. Last time I looked for that was in 0.9.4, which only seemed to have frozenset.
comment:4 by , 19 years ago
He, you're right, I thought it was there :)
Now frozenset has been moved in markup.
I think we should have both set
and frozenset
in in util/__init__.py
, then.
comment:5 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Okay, I've added frozenset
and set
to util/__init__.py
in r3136. frozenset
can't be removed from util/markup.py
unfortunately, due to a cyclic import.
Apologies, this is a Python 2.4ism. Will fix in next commit but until then you can add this to the top of api.py, just after the imports: