Ticket #954 (assigned defect)

Opened 2 years ago

Last modified 2 years ago

script does not work out of the box with .10.2

Reported by: greg@max-t.com Assigned to: bas (accepted)
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

email2trac.patch (405 bytes) - added by greg@max-t.com on 11/30/06 15:16:26.
Patch required to make it work with 0.10.2
email2trac.2.patch (0.8 kB) - added by greg@max-t.com on 11/30/06 15:24:41.
need the hack in new_ticket AND update_ticket - why?

Change History

11/30/06 15:16:26 changed by greg@max-t.com

  • attachment email2trac.patch added.

Patch required to make it work with 0.10.2

11/30/06 15:24:41 changed by greg@max-t.com

  • attachment email2trac.2.patch added.

need the hack in new_ticket AND update_ticket - why?

11/30/06 15:24:43 changed 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?

11/30/06 15:26:19 changed by coderanger

  • description changed.

Fix formatting.

11/30/06 15:30:07 changed 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!

11/30/06 15:35:38 changed 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 ;-)

11/30/06 15:47:39 changed by greg@max-t.com

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

12/01/06 11:11:57 changed 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 ;-(

12/06/06 04:11:58 changed 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 :-)

12/06/06 08:23:57 changed 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/Change #954 (script does not work out of the box with .10.2)




Change Properties
Action