[Twisted-Python] client crashed
Rick Graves
gravesricharde at yahoo.com
Sat Jan 13 02:33:31 MST 2007
Hello,
I am new to twisted.
I got one unhandled error (twice) in Deferred:
In this code in client.py (you can skip to the 2nd line from the bottom):
def _parse(url, defaultPort=None):
parsed = urlparse.urlparse(url)
scheme = parsed[0]
path = urlparse.urlunparse(('','')+parsed[2:])
if defaultPort is None:
if scheme == 'https':
defaultPort = 443
else:
defaultPort = 80
host, port = parsed[1], defaultPort
if ':' in host:
host, port = host.split(':')
port = int(port)
return scheme, host, port, path
Here is the end of the traceback:
File "/usr/lib/python2.4/site-packages/twisted/web/client.py", line 376, in _parse
port = int(port)
exceptions.ValueError: invalid literal for int():
I was running a script on a big list of URL's that I scraped off a google query.
I looked at each URL including a colon, but nothing jumped out at me.
Maybe the port = int(port) line should be within a try/except structure.
Should I report this somewhere else?
Thanks,
Rick Graves
More information about the Twisted-Python
mailing list