Hi,

I was writing a plug-in that has an ITicketChangeListener, and when I
used the BatchModifyPlugin I was surprised to get Ticket's with a str
as .id

I hadn't really paid attention before, assuming id's would always be
int.  I grepped the Trac source code and in all places I could find it's
expected to be an int.

I asked on IRC to make sure, and coderanger tells me that it should be
assumed that a Ticket.id is "anything that has a __str__ method", and
usually it comes straight from a database result.

So I proceeded to update my plugin to remove the integer assumptions,
and use str() everywhere to compare and manipulate, and my unit tests
ran into an exception that triggered a TypeError, in
trac.ticket.model.Ticket._fetch_ticket:
            raise TracError('Ticket %d does not exist.' % tkt_id,
                            'Invalid Ticket Number')

Can someone tell me if this is a bug (if I follow coderanger's
explanation) or if I'm missing something obvious ?

I'll submit a doc patch or fix to clarify once someone explains it.

BTW, this is on the 0.10.5 branch.

Thanks,
Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to