Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#3027 closed defect (fixed)

Ticket update broken

Reported by: pb@… 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 Alec Thomas, 19 years ago

Keywords: workflow added
Owner: changed from Jonas Borgström to Alec Thomas
Status: newassigned

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:

try:
  set = set
except:
  from sets import Set as set

comment:2 by Christian Boos, 19 years ago

Or better, use trac.util.set which already does the above:

  • api.py

     
    2121from trac.perm import IPermissionRequestor
    2222from trac.Search import ISearchSource, search_to_sql, shorten_result
    2323from trac.ticket.field import *
    24 from trac.util import shorten_line, to_list, to_bool
     24from trac.util import shorten_line, to_list, to_bool, set
    2525from trac.util.markup import html, Markup
    2626from trac.wiki import IWikiSyntaxProvider, Formatter

comment:3 by Alec Thomas, 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 Christian Boos, 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 Alec Thomas, 19 years ago

Resolution: fixed
Status: assignedclosed

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.

comment:6 by Alec Thomas, 19 years ago

Oh, and I finally managed to get the log syntax correct! ;)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Alec Thomas to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.