Opened 11 years ago

Closed 15 months ago

script does not work out of the box with .10.2

Reported by: Owned by: greg@… Bas van der Vlies normal EmailtoTracScript normal 0.10

When I updated to 0.10.2 all of a sudden email2trac broke. Digging a bit I see:

Traceback (most recent call last):
File "/usr/local/bin/email2trac", line 874, in ?
tktparser.parse(sys.stdin)
File "/usr/local/bin/email2trac", line 512, in parse
self.new_ticket(m)
File "/usr/local/bin/email2trac", line 407, in new_ticket
tkt = Ticket(self.env)
File "/usr/lib/python2.3/site-packages/trac/ticket/model.py", line 37, in __init__
self.fields = TicketSystem(self.env).get_ticket_fields()
File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 145, in get_ticket_fields
for field in self.get_custom_fields():
File "/usr/lib/python2.3/site-packages/trac/ticket/api.py", line 164, in get_custom_fields
field = {
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 1006, in wiki_to_oneliner
OneLinerFormatter(env, absurls, db).format(wikitext, out, shorten)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 859, in __init__
Formatter.__init__(self, env, None, absurls, db)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 236, in __init__
self.href = absurls and (req or env).abs_href or (req or env).href
AttributeError: 'Environment' object has no attribute 'href'


Which I've seen before. The attached patch fixes it (at least it seems to).

Changed 11 years ago by greg@…

Patch required to make it work with 0.10.2

Changed 11 years ago by greg@…

need the hack in new_ticket AND update_ticket - why?

comment:1 Changed 11 years ago by anonymous

Owner: changed from Bas van der Vlies to anonymous new → assigned

Thanks for the patch. I also run 0.10.2 and do not have any problems with 0.10.2. Which options did you have set and did you set the trac_version to 0.10 instead of the default 0.9 in email2trac.conf?

comment:2 Changed 11 years ago by Noah Kantrowitz

Description: modified (diff)

Fix formatting.

comment:3 Changed 11 years ago by anonymous

My config file:

[DEFAULT]
project: /home/tracroot/projectroot/Sledgehammer
debug: 2
spam_level: 4
email_comment: >
trac_version: 0.10
enable_syslog : 0
alternate_notify_template :
drop_spam : 0
verbatim_format: 1
strip_signatures: 1
ticket_update: 1


Its pretty easy to remember to change the version. If you don't it can't find Notify ;-) I had to do similar gymnastics with the post-commit script in the beginning. Those seem to have been integrated into the mainstream code now. Bear in mind that I don't really know what I'm doing but this seems to make it work ;-)

Thanks!

comment:4 Changed 11 years ago by Bas van der Vlies

Owner: changed from anonymous to Bas van der Vlies assigned → new

Thanks for the info. Still it is strange that you have a bug and at our site we do not encounter it. I shall do some test tomorrow. It is now 10:30 here ;-)

comment:5 Changed 11 years ago by greg@…

I do have a number of plugins and am using postgres but I can't think of why that would affect it. Perhaps something missing in trac.ini?

Thanks for reading the bug report, have a good night 8-)

comment:6 Changed 11 years ago by Bas van der Vlies

Status: new → assigned

Did not have time to test it today. Experience some other problems with trac 0.10.2 ;-(

comment:7 Changed 11 years ago by Bas van der Vlies

Can you sent me your trac.ini. I still have not reproduce the problem. I encounterd many other problems with 0.10.2 but this one not :-)

comment:8 Changed 11 years ago by anonymous

Actually I cannot, the trac-hacks ticket system keeps rejecting it as SPAM. In any case I guess it doesn't matter, its probably pretty specific to our setup if no one else is complaining about it.

Thanks for looking at it ;-)

Greg

comment:9 Changed 15 months ago by Ryan J Ollos

Resolution: → worksforme assigned → closed

Modify Ticket

Change Properties