Modify

Opened 17 years ago

Closed 7 years ago

#954 closed defect (worksforme)

script does not work out of the box with .10.2

Reported by: greg@… Owned by: Bas van der Vlies
Priority: normal Component: EmailtoTracScript
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description (last modified by Noah Kantrowitz)

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@… 17 years ago.
Patch required to make it work with 0.10.2
email2trac.2.patch (769 bytes) - added by greg@… 17 years ago.
need the hack in new_ticket AND update_ticket - why?

Download all attachments as: .zip

Change History (11)

Changed 17 years ago by greg@…

Attachment: email2trac.patch added

Patch required to make it work with 0.10.2

Changed 17 years ago by greg@…

Attachment: email2trac.2.patch added

need the hack in new_ticket AND update_ticket - why?

comment:1 Changed 17 years ago by anonymous

Owner: changed from Bas van der Vlies to anonymous
Status: newassigned

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 17 years ago by Noah Kantrowitz

Description: modified (diff)

Fix formatting.

comment:3 Changed 17 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 17 years ago by Bas van der Vlies

Owner: changed from anonymous to Bas van der Vlies
Status: assignednew

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 17 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 17 years ago by Bas van der Vlies

Status: newassigned

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

comment:7 Changed 17 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 17 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 7 years ago by Ryan J Ollos

Resolution: worksforme
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Bas van der Vlies.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.