Modify

Opened 8 years ago

Last modified 8 years ago

#954 assigned defect

script does not work out of the box with .10.2

Reported by: greg@… Owned by: bas
Priority: normal Component: EmailtoTracScript
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description (last modified by coderanger)

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).

Attachments (2)

email2trac.patch (405 bytes) - added by greg@… 8 years ago.
Patch required to make it work with 0.10.2
email2trac.2.patch (769 bytes) - added by greg@… 8 years ago.
need the hack in new_ticket AND update_ticket - why?

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by greg@…

Patch required to make it work with 0.10.2

Changed 8 years ago by greg@…

need the hack in new_ticket AND update_ticket - why?

comment:1 Changed 8 years ago by anonymous

  • Owner changed from bas to anonymous
  • Status changed from new to 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 8 years ago by coderanger

  • Description modified (diff)

Fix formatting.

comment:3 Changed 8 years ago by anonymous

My config file:

[DEFAULT]
project: /home/tracroot/projectroot/Sledgehammer
debug: 2
umask: 022
spam_level: 4
reply_all : 1
mailto_link: 0
umask: 022
email_comment: >
email_header: 0
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 8 years ago by bas

  • Owner changed from anonymous to bas
  • Status changed from assigned to 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 8 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 8 years ago by bas

  • Status changed from new to assigned

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

comment:7 Changed 8 years ago by bas

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 8 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

Add Comment

Modify Ticket

Action
as assigned The owner will remain bas.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.