[Zope] Netscape Image Problems (LoginManager?)

andres@corrada.com andres@corrada.com
Thu, 25 May 2000 11:07:49 -0400


On Wed, May 24, 2000 at 02:19:43PM +0100, Chris Withers wrote:
> > > Given Itamar's comments, I have changed his suggestion as follows:
> > > 
> > > >   You can try to fix this problem, by removing the "int(...)"
> > > >   in "OFS.Image.py:186"
> > > > 
> > > 
> > > -            mod_since=int(DateTime(header).timeTime())
> > >  
> > > +            mod_since=long(DateTime(header).timeTime())
> > 
> > I've checked this in for 2.2. Thanks for investigating 
> > this guys!
> > 
> > --Brian
> 
> Woohoo! :-)
> 
> Chris
> 

I've changed Image.py as suggested in the line above but I was still getting
some strange behaviour so I pursued it a little bit further. I encountered
the following strange behaviour when using the debugger to step through the
code:

The image I'm looking for has:

 Last-Modified: Wed, 15 Mar 2000 19:02:17 GMT

Upon executing:

 ZPublisher.Zope('/path/to/image', d=1)
 
and stepping into the debugger I set:
 
 environ['IF_MODIFIED_SINCE'] = 'Wed, 15 Mar 2000 19:02:17 GMT'
 
when I get to lib/python/OFS/Image.py(line 188) I get the following strange
results:

> OFS/Image.py(188)index_html() 
-> if last_mod > 0 and last_mod <= mod_since: 
pdb> print mod_since, last_mod 
953146936 953146937                       <<<< Something is wrong! mod_since
                                               should equal last_mod
pdb> print DateTime(header).timeTime() 
953146937.0 
pdb> print self._p_mtime 
953146937.38 
pdb> int(953146937.0)
953146937 
pdb> print int(DateTime(header).timeTime()) 
953146936                                    <<<< WHAT!?
pdb> type( DateTime(header).timeTime() ) 
<type 'float'> 
pdb> int(DateTime(header).timeTime()) 
953146936                                    <<<< I still don't believe this.
pdb> DateTime(header).timeTime()
953146937.0 
pdb> print header 
Wed, 15 Mar 2000 19:02:17 GMT 
pdb> long(DateTime(header).timeTime()) 
953146936L                                   <<<< long also does it!?

I'm completly baffled by this, how can int/long be interacting with
DateTime(header).timeTime() to produce this error?


------------------------------------------------------
Andres Corrada-Emmanuel   Email: andres@corrada.com
------------------------------------------------------