Opened 5 years ago

Last modified 3 years ago

#4119 defect new

Windows 7: A non-blocking socket operation could not be completed immediately

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

Description (last modified by exarkun)

Windows 7: A non-blocking socket operation could not be completed immediately

I'm on Windows 7 64, Python 2.6.4, Twisted 8.2.0

from twisted.internet import reactor, protocol
class Echo(protocol.Protocol):
   def dataReceived(self, data):
      self.transport.write(data)
factory = protocol.ServerFactory()
factory.protocol = Echo
reactor.listenTCP(8000, factory)
reactor.run()

It crashes at once with the following message:

Traceback (most recent call last):
  File "C:\Users\tom\Documents\server.py", line 5, in <module>
    reactor.listenTCP(8000, Echo())
  File "C:\Program Files (x86)\Python\lib\site-packages\twisted\internet\posixbase.py", line 356, in listenTCP
    p.startListening()
  File "C:\Program Files (x86)\Python\lib\site-packages\twisted\internet\tcp.py", line 862, in startListening
    self._realPortNumber = skt.getsockname()[1]
  File "<string>", line 1, in getsockname
socket.error: [Errno 10035] A non-blocking socket operation could not be completed immediately

tried this patch, but nothing changes:

from twisted.python.util import untilConcludes
self._realPortNumber = untilConcludes(lambda: skt.getsockname()[1])

Change History (2)

comment:1 Changed 5 years ago by exarkun

  • Milestone Python-2.6 deleted
  • Owner changed from glyph to PenguinOfDoom
  • Priority changed from high to normal

(adjusting some metadata: I doubt this is a Python 2.6-specific issue, so the Python 2.6 milestone isn't suitable; also we don't really use priorities at all, but if we did, high would probably be reserved for bugs on supported platforms or regressions.)

comment:2 Changed 3 years ago by exarkun

  • Description modified (diff)

Fixing the reproduction instructions (incomplete though they may be) in the description.

Note: See TracTickets for help on using tickets.