[New-bugs-announce] [issue8184] multiprocessing.managers will not fail if listening ocket already in use

news1234 report at bugs.python.org
Sat Mar 20 18:08:52 CET 2010


New submission from news1234 <news1234 at free.fr>:

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.

----------
components: Library (Lib), Windows
messages: 101380
nosy: news1234
severity: normal
status: open
title: multiprocessing.managers will not fail if listening ocket already in use
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8184>
_______________________________________


More information about the New-bugs-announce mailing list