Last active
August 29, 2015 14:16
-
-
Save adiroiban/3967df30aca9add2eb9a to your computer and use it in GitHub Desktop.
Unhandled exceptions.OverflowError: getsockaddrarg: port must be 0-65535.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./build-ubuntu1404-x64/bin/python test.py | |
Unhandled error in Deferred: | |
Unhandled Error | |
Traceback (most recent call last): | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks | |
current.result = callback(current.result, *args, **kw) | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/base.py", line 250, in _checkTimeout | |
userDeferred.callback(result) | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/defer.py", line 368, in callback | |
self._startRunCallbacks(result) | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks | |
self._runCallbacks() | |
--- <exception caught here> --- | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks | |
current.result = callback(current.result, *args, **kw) | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/tcp.py", line 432, in _setRealAddress | |
self.doConnect() | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/site-packages/twisted/internet/tcp.py", line 561, in doConnect | |
connectResult = self.socket.connect_ex(self.realAddress) | |
File "/home/adi/chevah/server/build-ubuntu1404-x64/lib/python2.7/socket.py", line 224, in meth | |
return getattr(self._sock,name)(*args) | |
exceptions.OverflowError: getsockaddrarg: port must be 0-65535. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet import reactor | |
from twisted.web.client import Agent | |
from twisted.web.http_headers import Headers | |
agent = Agent(reactor) | |
d = agent.request( | |
'GET', | |
'http://example.com:12345679/', | |
Headers({'User-Agent': ['Twisted Web Client Example']}), | |
None) | |
def cbResponse(ignored): | |
print 'Response received' | |
d.addCallback(cbResponse) | |
def ebResponse(failure): | |
print 'Error received' | |
print failure.getErrorMessage() | |
d.addErrback(ebResponse) | |
def cbShutdown(ignored): | |
reactor.stop() | |
d.addBoth(cbShutdown) | |
reactor.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment