Opened 15 years ago
Last modified 5 years ago
#5535 new defect
unrecoverable error when "blocking" value is (or was!) invalid
Reported by: | Bernhard | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | high | Component: | MasterTicketsPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
This looks similar to #1326, but appears in SVN 4179 of MasterTicketsPlugin (using Trac 0.11.1): a ticket had the value of '#12' in the "blocking" field. When opening that ticket, trac says
Trac detected an internal error: ValueError: invalid literal for int() with base 10: '#12'
I then switched off the MasterTicketsPlugin (using the Admin tab), opened the ticket, changed the "blocking" value to '12', and switched the MasterTicketsPlugin on again.
Surprisingly, the same error message appeared again. I can still not open that ticket that had an invalid blocking value before!
I have a ticket database converted from 0.10, where this format always used to work, so this bug now prevents me from activating the MasterTicketsPlugin on 0.11.1.
Attachments (0)
Change History (5)
comment:1 Changed 15 years ago by
Priority: | normal → high |
---|
comment:2 Changed 15 years ago by
comment:3 Changed 11 years ago by
Owner: | changed from Noah Kantrowitz to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:4 Changed 10 years ago by
Quick & nice solution for this problem is mentioned in: https://issue.gcube-system.org/ticket/362
It simply replaces int()
call with tonum()
call.
I'm copy&pasting it here:
- mastertickets/web_ui.py:
59 61 # Add link to depgraph if needed 60 62 if links: 61 63 add_ctxtnav(req, 'Depgraph', req.href.depgraph(tkt.id)) 62 64 65 def tonum(n): 66 if n.startswith('#'): 67 n = n[1:] 68 return int(n) 69 63 70 for change in data.get('changes', []): 64 71 for field, field_data in change['fields'].iteritems(): 65 72 if field in self.fields: 66 73 if field_data['new'].strip(): 67 new = set([--int--(n) for n in field_data['new'].split(',')]) 74 new = set([__tonum__ (n) for n in field_data['new'].split(',')]) 68 75 else: 69 76 new = set() 70 77 if field_data['old'].strip(): 71 old = set([--int--(n) for n in field_data['old'].split(',')]) 78 old = set([__tonum__(n) for n in field_data['old'].split(',')]) 72 79 else: 73 80 old = set() 74 81 add = new - old
comment:5 Changed 5 years ago by
Status: | assigned → new |
---|
I had the same with TracMasterTickets 2.1.3. I fixed it manual in the trac.db. My "blocking" value was '
#616
' but should be '616
':