Thanks for ur suggestions Terry.These are really helpful for a newbie like me in python programming.<br><br>Regards<br>Venkat<br><br><div class="gmail_quote">On Wed, Apr 1, 2009 at 5:59 AM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">venkat sanaka wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
This was the code i executed.<br>
<br></div>
 >>> proxies={'http':'<a href="http://10.1.2.21:9090" target="_blank">10.1.2.21:9090</a> <<a href="http://10.1.2.21:9090" target="_blank">http://10.1.2.21:9090</a>>'}<div class="im"><br>
 >>> opener = urllib.request.FancyURLopener(proxies)<br>
 >>> f = opener.open("<a href="http://www.python.org" target="_blank">http://www.python.org</a>")<br>
<br>
Exception AttributeError: AttributeError("'FancyURLopener' object has no attribute 'tempcache'",) in <bound method FancyURLopener.__del__ of <urllib.request.FancyURLopener object at 0x010A40F0>> ignored<br>

Traceback (most recent call last):<br>
  File "<pyshell#11>", line 1, in <module><br>
    f = opener.open("<a href="http://www.python.org" target="_blank">http://www.python.org</a>")<br>
  File "C:\Python30\lib\urllib\request.py", line 1439, in open<br>
    return self.open_unknown_proxy(proxy, fullurl, data)<br>
  File "C:\Python30\lib\urllib\request.py", line 1458, in open_unknown_proxy<br>
    raise IOError('url error', 'invalid proxy for %s' % type, proxy)<br></div>
IOError: [Errno url error] invalid proxy for http: '<a href="http://10.1.2.21:9090" target="_blank">10.1.2.21:9090</a> <<a href="http://10.1.2.21:9090" target="_blank">http://10.1.2.21:9090</a>>'<br>
</blockquote>
<br>
If you do not understand the error message and the error is in Python code, you can go look at the code in the file to get a better idea.  In this case, the 'raise' statement is almost certainly preceded by an if statement.  See what condition was checked that your input would fail. If necessary, you can edit request.py to add print statements (what I would do, after copying to request.bak) what args are actually passed to open_unknown_proxy.  Or try pdb (which I never have).<br>

<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I know that url has to be used in proxies list but my proxy address is <a href="http://10.1.2.21:9090" target="_blank">10.1.2.21:9090</a> <<a href="http://10.1.2.21:9090" target="_blank">http://10.1.2.21:9090</a>> and it is squid proxy server.<br>

<br>
Regards<br>
venkat<div class="im"><br>
<br>
On Wed, Apr 1, 2009 at 4:35 AM, Chris Rebert <<a href="mailto:clp2@rebertia.com" target="_blank">clp2@rebertia.com</a> <mailto:<a href="mailto:clp2@rebertia.com" target="_blank">clp2@rebertia.com</a>>> wrote:<br>

<br>
    2009/3/31 venkat sanaka <<a href="mailto:venkatsanaka@gmail.com" target="_blank">venkatsanaka@gmail.com</a><br></div>
    <mailto:<a href="mailto:venkatsanaka@gmail.com" target="_blank">venkatsanaka@gmail.com</a>>>:<div class="im"><br>
     > hii everyone<br>
     ><br>
     > I am new to python programming.And i started implementing a http<br>
    client<br>
     > using urllib in which<br>
     > i was facing a problem with proxy support.i was behind a proxy<br>
    server and<br>
     > need to use<br></div>
     > proxy of format <a href="http://10.1.2.21:8080" target="_blank">10.1.2.21:8080</a> <<a href="http://10.1.2.21:8080" target="_blank">http://10.1.2.21:8080</a>> to connect<div class="im"><br>
    to internet.when i used this with<br>
     > proxyhandler<br>
     > of urllib i got errors showing invalid proxy.can someone help me<br>
    out plzzz.<br>
<br>
    What errors exactly? People will need the error message and full<br>
    traceback in order to help you.<br>
    A copy of your code would also be necessary for anyone trying to<br>
    help you.<br>
<br>
    Cheers,<br>
    Chris<br>
    --<br>
    I have a blog:<br>
    <a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
<br>
<br>
<br></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></blockquote><div><div></div><div class="h5">
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>