Print

Print


Hi Wayne,
I did as you suggested, and here is the output:

>>> *********************
HERE10 ('http',
'//mole.bio.cam.ac.uk/~ccpn/ccpNmrUpdate/__UpdateAgentData.db')
HERE11 {'http': 'http://'}
HERE12 http://
HERE13 ('http', '//')
HERE14 ('', '')
HERE3  ('', '
http://mole.bio.cam.ac.uk/~ccpn/ccpNmrUpdate/__UpdateAgentData.db')
HERE4
Exception in Tkinter callback
Traceback (most recent call last):
  File "/sw/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
    return self.func(*args)
(...etc...)

Hope that gives some clue.

-Jeremy

On Wed, Mar 26, 2008 at 1:41 AM, Wayne Boucher <[log in to unmask]>
wrote:

> Right, when the code is getting to that point the host
> (mole.bio.cam.ac.uk) has been lost for some reason.  The only way I can
> see this happening is further upstream in lines 173-177, which involves
> proxies.  So you could try modifying those lines to:
>
>        print 'HERE10', (urltype, url)
>        if urltype in self.proxies:
>            print 'HERE11', self.proxies
>            proxy = self.proxies[urltype]
>            print 'HERE12', proxy
>            urltype, proxyhost = splittype(proxy)
>            print 'HERE13', (urltype, proxyhost)
>            host, selector = splithost(proxyhost)
>            print 'HERE14', (host, selector)
>            url = (host, fullurl) # Signal special case to open_*()
>
> By the time you get to HERE14 the host has been splatted.  It's possibly
> this is because the proxy in HERE12 is just rubbish.  Looking at the code
> it looks like self.proxies ought to be empty, in which case going into
> that "if" block would not happen.  But that's the only bit of code I can
> see that is modifying the url in the way indicated by the messages further
> downstream.
>
> Wayne
>
> On Tue, 25 Mar 2008, Jeremy wrote:
>
> > Hi Wayne,
> > Thanks for the reply.  My coworkers actually use Python 2.5, so that is
> > likely not the problem.  I added the five lines and the output was as
> > follows:
> >
> > HERE3 ('', '
> > http://mole.bio.cam.ac.uk/~ccpn/ccpNmrUpdate/__UpdateAgentData.db')
> > HERE4
> > Exception in Tkinter callback
> > Traceback (most recent call last):
> >   File "/sw/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
> >     return self.func(*args)
> > (...etc...)
> >
> > Hope this gives you some information.
> >
> > Jeremy
> >
> >
> >
> > On Tue, Mar 25, 2008 at 1:39 PM, Wayne Boucher <[log in to unmask]
> >
> > wrote:
> >
> > > Hello,
> > >
> > > That bit of urllib.py is a bit opaque, but the only thing I can see
> that
> > > might be going on weird is to do with proxies.  Are your coworkers
> using
> > > Python <=2.4?  I did a diff between the Python 2.4 and 2.5 urllib.pycode
> > > and the main differences are to do with proxy handling, but not
> obviously
> > > at the root of this problem so this could be irrelevant.  The one way
> to
> > > really find out what is going on is to edit
> > >
> > >  /sw/lib/python2.5/urllib.py
> > >
> > > and to put in various checks along the way.  If you have adminstrator
> > > access (which I assume you do) then you could add some debugging to
> the
> > > function open_http to get (I've added five debugging lines below):
> > >
> > >    def open_http(self, url, data=None):
> > >        """Use HTTP protocol."""
> > >        import httplib
> > >        user_passwd = None
> > >        proxy_passwd= None
> > >        if isinstance(url, str):
> > >            host, selector = splithost(url)
> > >            print 'HERE1', url, host
> > >            if host:
> > >                user_passwd, host = splituser(host)
> > >                host = unquote(host)
> > >            realhost = host
> > >            print 'HERE2', host
> > >        else:
> > >            host, selector = url
> > >            print 'HERE3', url, host
> > >            # check whether the proxy contains authorization
> information
> > >            proxy_passwd, host = splituser(host)
> > >            print 'HERE4', host
> > >            # now we proceed with the url we want to obtain
> > >            urltype, rest = splittype(selector)
> > >            url = rest
> > >            user_passwd = None
> > >            if urltype.lower() != 'http':
> > >                realhost = None
> > >            else:
> > >                realhost, rest = splithost(rest)
> > >                if realhost:
> > >                    user_passwd, realhost = splituser(realhost)
> > >                if user_passwd:
> > >                    selector = "%s://%s%s" % (urltype, realhost, rest)
> > >                if proxy_bypass(realhost):
> > >                    host = realhost
> > >                    print 'HERE5', host
> > >
> > >            #print "proxy via http:", host, selector
> > >         if not host: raise IOError, ('http error', 'no host given')
> > >
> > > Wayne
> > >
> > > On Tue, 25 Mar 2008, Jeremy wrote:
> > >
> > > > Thanks for the quick replies.  I do not think it is a firewall issue
> > > (although I am behind one), as my
> > > > coworkers (running Linux or Tiger) are able to update just fine.
> > > >
> > > > Any further ideas?
> > > >
> > > > Thanks,
> > > > Jeremy
> > > >
> > >
> >
>