Skip to content

Instantly share code, notes, and snippets.

@adiroiban adiroiban/output
Last active Aug 29, 2015

Embed
What would you like to do?
Unhandled exceptions.OverflowError: getsockaddrarg: port must be 0-65535.
$ ./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.
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
You can’t perform that action at this time.