Broken Library Code, suggested course of action

M

Melih Onvural

I've been trying to use the URLParse library, and I thought I had all
of the kinks worked out when I ran into this:

Traceback (most recent call last):
File "./run.py", line 130, in ?
main()
File "./run.py", line 126, in main
r = crawl.crawl(p, x)
File "/home/monvural/src/crawl.py", line 74, in crawl
root = parser.legiturl(url)
File "/home/monvural/src/crawl.py", line 22, in legiturl
t = urlparse.urlparse(url)
File "/usr/lib/python2.4/urlparse.py", line 50, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib/python2.4/urlparse.py", line 89, in urlsplit
i = url.find(':')
AttributeError: 'tuple' object has no attribute 'find'

I have just recently upgraded my system to FC6, and I wasn't sure if
this was an issue of version change. Why does the urlsplit() function
work on my old station, but here I'm getting a tuple cannot find
error. I understand from looking at the docs that tuples cannot have
operations done onto them as they are immutable and sans index, but
there has to be a way to dive into the http address and parse what's
there. Thanks for any suggestions,

--Melih Onvural
 
B

Bruno Desthuilliers

Melih Onvural a écrit :
I've been trying to use the URLParse library, and I thought I had all
of the kinks worked out when I ran into this:

Traceback (most recent call last):
File "./run.py", line 130, in ?
main()
File "./run.py", line 126, in main
r = crawl.crawl(p, x)
File "/home/monvural/src/crawl.py", line 74, in crawl
root = parser.legiturl(url)
File "/home/monvural/src/crawl.py", line 22, in legiturl
insert this line here:
print "url : ", url, type(url)
t = urlparse.urlparse(url)
File "/usr/lib/python2.4/urlparse.py", line 50, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib/python2.4/urlparse.py", line 89, in urlsplit
i = url.find(':')
AttributeError: 'tuple' object has no attribute 'find'

I guess you'll find that you pass a tuple instead of a string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top