Re: aap 1.090 - issues with DEFAULTCHECK=newer

Pavol Juhas <[email protected]> Tue, 11 Dec 2007 17:28:13 -0500
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
On Fri, Dec 07, 2007 at 10:48:53PM +0100, Bram Moolenaar wrote:
> Pavol Juhas wrote:
> 
> > I have recently tried to use DEFAULTCHECK=newer in my aap recipe
> > and found a couple of issues.  First, aap 1.090 would crash with this
> > setting, because python getmtime function returns float, and
> > a string representation of float cannot be converted to long [e.g.,
> > long("0.0") raises an exception].
> > 
> > It was very simple to fix this, see the attached patch,
> 
> Thanks.  I guess an older verion of Python allowed this.

I just realized it may be better to store file modification times
as floats instead of longs.  Python float is large enough to avoid
any overflow issues and it is the same type as returned by built-in
getmtime().  Float would also prevent any loss of precision
should getmtime() resolution become smaller than 1 second in the future.

So the previous patch should rather say
     atime = float(atime)
instead of
     atime = long(float(atime))

Thanks,

Pavol

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php