[ZCM] [ZC] 2245/ 2 Reject "error with simple python script loop "
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2245 Update (Reject) "error with simple python script loop " Status Rejected, Zope/bug medium To followup, visit: http://www.zope.org/Collectors/Zope/2245 ============================================================== = Reject - Entry #2 by chrisw on Nov 24, 2006 7:03 am Status: Pending => Rejected This belong on the [email protected] mailing list. You need to include the actual error you see when you mail ther. ________________________________________ = Request - Entry #1 by knowit on Nov 24, 2006 6:57 am I have an problem with this little script. The script is in the zope file structure and it is an -Script (Python)- The script should send 2 emails over the mailhost, but it sends 4 emails. I have test this with maildrophost product too, same problem. I have test it on Zope 2.10.0 and Zope 2.64. The problem is the same - everytime. This script produce the error: #### start #### for i in range(2): subj = str(i) + ' range python' context.MailHost.send('range test with python', "[email protected]", "[email protected]", subj) #### end #### This script produce no error: #### start #### for i in range(2): subj = str(i) + ' range python' context.MailHost.send('range test with python', "[email protected]", "[email protected]", subj) return 'eof' #### end #### So if i make a return (not in the loop) the script works fine. Can anybody tell me why? It feels like that there are any spaces in the script and zope/python did not work correctly when there is no other procedure after the for loop. I dont understand why he calls the loop two times and produce 4 emails. There is no transactional error in the error_log. thx for help ==============================================================