Trouble with proxies

Guido van Rossum guido at eric.cnri.reston.va.us
Fri Apr 30 23:40:48 EDT 1999


Bruce Fletcher <befletch at my-dejanews.com> writes:

> No matter which proxy string I use, or which URL, I get the following:
> 
>  <addinfourl at 9536416 whose fp = <socket._fileobject instance at 916b20>>
>  <HEAD><TITLE>403 Forbidden</TITLE></HEAD>
> 
>  <BODY><H1>403 Forbidden</H1>
> 
>  <P>The request was not properly formatted.  A possible security risk
>  detected.</P>
> 
>  Traceback (innermost last):
>   File "C:\PROGRA~1\PYTHON\TOOLS\IDLE\ScriptBinding.py", line 131, in
>  run_module_event
>     execfile(filename, mod.__dict__)
>   File "C:\Users\Bruce\postal codes\idle_experiment.py", line 19, in ?
>     data = f.readline()
>   File "C:\Program Files\Python\Lib\plat-win\socket.py", line 117, in readline
>     new = self._sock.recv(self._rbufsize)
>  error: (10054, 'winsock error')
> 
> It would appear that the proxy server isn't at issue.  Who is
> generating that HTML output, anyway?

My guess is that your proxy server generates that HTML!  Now you have
a clue -- look it up in the server's documentation.  I'm guessing that
it requires some optional HTTP header that modern browsers always send
but that poor li'l urllib.py doesn't yet know about.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list