Can someone explain to me how to run fakemail on
windows with python?
I have Python version 2.3.5
When I try to execute from the command line this is
what I receive:
C:\apache2triad\python\Scripts>python fakemail.py
--host=locahost --port=10025 -
-path=.
Traceback (most recent call last):
File "fakemail.py", line 147, in ?
main()
File "fakemail.py", line 129, in main
handle_signals()
File "fakemail.py", line 78, in handle_signals
for sig in (signal.SIGINT, signal.SIGTERM,
signal.SIGHUP):
AttributeError: 'module' object has no attribute 'SIGHUP'
C:\apache2triad\python\Scripts>
Please help.
Cheers,
Matt
Logged In: NO
I'm having this trouble too, with Python 2.5.1 under Windows XP.
Should I be abandoning Python altogether? Is this a configuration issue and silence means we're idiots?
Does the Perl flavor of this work in Windows?
Windows does not know the SIGHUP signal. I changed line 78 in fakemail.py
for sig in (signal.SIGINT, signal.SIGTERM, signal.SIGHUP):
to
for sig in (signal.SIGINT, signal.SIGTERM):
which seems to do the trick for me.
HTH,
Wolfgang
Possible solution for Windows - up from line 73:
def handle_signals():
def signal_handler(signum, frame):
quit()
if os.name == 'posix':
signals = (signal.SIGINT, signal.SIGTERM, signal.SIGHUP)
## Above for Unix. Below for Windows
elif os.name == 'nt':
signals = (signal.SIGINT, signal.SIGTERM, signal.SIGABRT)
for sig in signals:
signal.signal(sig, signal_handler)
That is much cleaner than my first hack.
I created a patch using your code and added it to the tracker (2990794).
Would be great if someone could merge it.
Thanks in advance,
Wolfgang