Re: fetch-bug?

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
PieterB wrote:

> I get an internal error when using Aap 1.010 with Python 2.3 on FreeBSD
> 5.1 RELEASE. Here's the traceback:
> 
> # aap
> Aap: Attempting download of
> "http://aleron.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.3.tar.gz"
> Aap: Internal Error
> Aap: Traceback (most recent call last):
[...]
>    File "/usr/local/lib/aap/Exec-1.010/Remote.py", line 132, in
> url_download
>     if scope:
>    File "/usr/local/lib/aap/Exec-1.010/Scope.py", line 96, in
> __getattr__
>     return self.data[key]
>  KeyError: '__nonzero__'
> 
> Aap: Aborted
[...]
> Is this a aap-bug, or is something wrong with my recipe?
> Thanks in advance,

This is a bug in Aap.  Apparently Python 2.3 triggers this, there were
no problems before.  Although I also notice that a recent change caused
a problem as well.

I'll make a few changes to the code.  The main problem is in Remote.py,
this diff should fix that:

*** Remote.py.orig	Wed Aug 13 18:34:41 2003
--- Remote.py	Wed Aug 13 18:25:59 2003
***************
*** 129,145 ****
      # First try using a function the user specified, this overrules our own
      # stuff.
      scope = recdict.get("_no")
!     if scope:
          user_func = scope.get("fetch_" + fscheme)
!         if user_func:
!             if fname == '':
!                 from RecPython import tempfname
!                 resfile = tempfname()
!             else:
!                 resfile = fname
!             res = apply(user_func, (recdict, fmach, fpath, resfile))
!             if not res:
!                 raise IOError, (_("fetch_%s() could not download %s")
                                                                % (fscheme, url))
  
      elif fscheme == 'rcp':
--- 129,147 ----
      # First try using a function the user specified, this overrules our own
      # stuff.
      scope = recdict.get("_no")
!     if not scope is None:
          user_func = scope.get("fetch_" + fscheme)
!     else:
!         user_func = None
!     if user_func:
!         if fname == '':
!             from RecPython import tempfname
!             resfile = tempfname()
!         else:
!             resfile = fname
!         res = apply(user_func, (recdict, fmach, fpath, resfile))
!         if not res:
!             raise IOError, (_("fetch_%s() could not download %s")
                                                                % (fscheme, url))
  
      elif fscheme == 'rcp':

-- 
hundred-and-one symptoms of being an internet addict:
117. You are more comfortable typing in html.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.