Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4361 defect closed duplicate (duplicate)

[PATCH] Reactor sometimes refuses to start on Windows (can't assign requested address for InstallWaker)

Reported by: Szumo Owned by:
Priority: normal Milestone:
Component: core Keywords: easy windows
Cc: Branch:
Author: Szumo Launchpad Bug:

Description

Trying to start trial on Windows sometimes results in following traceback:

    from twisted.internet import reactor, protocol, error, defer
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\reactor.py", line 38, in <module>
    selectreactor.install()
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\selectreactor.py", line 200, in install
    reactor = SelectReactor()
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\selectreactor.py", line 72, in __init__
    posixbase.PosixReactorBase.__init__(self)
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\posixbase.py", line 171, in __init__
    ReactorBase.__init__(self)
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\base.py", line 470, in __init__
    self._initThreads()
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\base.py", line 892, in _initThreads
    self.installWaker()
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\posixbase.py", line 207, in installWaker
    self.waker = _Waker(self)
  File "c:\python25\lib\site-packages\twisted-10.0.0-py2.5-win32.egg\twisted\internet\posixbase.py", line 75, in __init__
    client.connect(server.getsockname())
  File "<string>", line 1, in connect
socket.error: (10049, "Can't assign requested address")

It turns out socket.getsockname _sometimes_ returns ('0.0.0.0', port) instead of ('127.0.0.1', port) on Windows.

I use attached simple patch to fix the problem, could one of core developers please review/commit it.

Attachments (1)

patch (692 bytes) - added by Szumo 4 years ago.
Patch to internet/posixbase.py

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by Szumo

Patch to internet/posixbase.py

comment:1 Changed 4 years ago by exarkun

  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the patch. This looks a lot like a duplicate of #3831, though. Can you re-open that ticket and comment about why it shouldn't have been closed? There's some discussion there about what causes this; if you could comment on the validity of that as well, it would be very helpful.

comment:2 Changed 4 years ago by Szumo

Did so, problem seems indeed to be caused by AVG 8.5.

comment:3 Changed 3 years ago by <automation>

  • Owner glyph deleted
Note: See TracTickets for help on using tickets.