By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,813 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,813 IT Pros & Developers. It's quick & easy.

smptlib frustration!

P: n/a
Joe
Ok I have written a perfectly well working script that uses smptlib
module to email myself if the script ended in success or failure.
However, this module automatically outputs the results to the console
to show the status of the connection/send/recieve etc... This is a
big problem for me. I am trying to run this script from Backup Exec
as a pre-processing job. This causes my script to always fail because
Backup Exec pre-processing jobs can not output to a console! What am
I to do? Is there a way to stop this module from outputing the status
to the console without having to actually modify the standard module?
Thanks!
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Joe wrote:
Ok I have written a perfectly well working script that uses smptlib
module to email myself if the script ended in success or failure.
However, this module automatically outputs the results to the console
to show the status of the connection/send/recieve etc... This is a
big problem for me. I am trying to run this script from Backup Exec
as a pre-processing job. This causes my script to always fail because
Backup Exec pre-processing jobs can not output to a console! What am
I to do? Is there a way to stop this module from outputing the status
to the console without having to actually modify the standard module?


If you must do this from within the program rather than being
able to do the simplest thing, which is to use redirection to
dump the output to nowhere... (/dev/null or >nil depending on
your OS, if it's Linux or Win32)... then you can use something
like this:

import sys
class Sink:
def write_null(self, *pargs):
pass
sys.stdout = sys.stderr = Sink()

There may be a simplification possible, but it's been a while since
I've had to do that...

-Peter
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.