469,366 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Broken Library Code, suggested course of action

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

Feb 5 '07 #1
1 1311
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.
Feb 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

43 posts views Thread by Steven T. Hatton | last post: by
4 posts views Thread by cmcvicker | last post: by
5 posts views Thread by A. Prock | last post: by
25 posts views Thread by Norman Diamond | last post: by
5 posts views Thread by jacob navia | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.