urllib error on urlopen

Mike Driscoll kyosohma at gmail.com
Thu Sep 25 09:13:48 EDT 2008


On Sep 24, 9:36 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Wed, 24 Sep 2008 08:46:56 -0700, Mike Driscoll wrote:
> > Hi,
>
> > I have been using the following code for over a year in one of my
> > programs:
>
> > f = urllib2.urlopen('https://www.companywebsite.com/somestring')
>
> > It worked great until the middle of the afternoon yesterday. Now I get
> > the following traceback:
> ...
> > URLError: <urlopen error (1, 'error:140770FC:SSL
> > routines:SSL23_GET_SERVER_HELLO:unknown protocol')>
>
> Have you recently set a proxy where Python can auto-detect it? I
> understand that urllib2 doesn't work well with https proxies.
>
> If so, you can instruct urllib2 not to use a proxy-handler, but it's more
> work. What I do is construct an opener without a proxyhandler:
>
> # untested...
> no_proxy_support = urllib2.ProxyHandler({})
> opener = urllib2.build_opener(no_proxy_support)
> f = opener.open('https://www.companywebsite.com/somestring')
>
> If that doesn't work, you may need to build a Request object from the URL
> before passing it to opener.open.
>
> --
> Steven

As I mentioned to Mr. Palmer, the error has mysteriously gone away
this morning. I'll keep your advice handy though, in case it happens
again.

Thanks,

Mike



More information about the Python-list mailing list