Author news1234
Recipients news1234
Date 2010-03-20.17:08:50
SpamBayes Score 7.74532e-05
Marked as misclassified No
Message-id <1269104932.24.0.802901286813.issue8184@psf.upfronthosting.co.za>
In-reply-to
Content
Following code snippet will behave differently on Linux and windows hosts.

Under linux the script can only be run once.
The second call will raise an exception, as the previous program is
already listening to pot 8089.


Under Windows however the program can be started twice.
and will print twice "serving". This surprises me

The script:
# ##########################
import socket,sys
from multiprocessing.managers import BaseManager

mngr = BaseManager(address=('127.0.0.1',8089),authkey='verysecret')
try:
    srvr = mngr.get_server()
except socket.error as e:
    print "probably address already in use"
    sys.exit()
print "serving"
srvr.serve_forever()


Perhaps the reason for the problem might be related to
http://bugs.python.org/issue2550


I'd suggest to fix multiprocessing.managers.BaseManager such, that it behaves identially on both platforms.
History
Date User Action Args
2010-03-20 17:08:52news1234setrecipients: + news1234
2010-03-20 17:08:52news1234setmessageid: <1269104932.24.0.802901286813.issue8184@psf.upfronthosting.co.za>
2010-03-20 17:08:51news1234linkissue8184 messages
2010-03-20 17:08:50news1234create