Message3928

Author pjenvey
Recipients fwierzbicki, pjenvey, thijs, worlddominationkites
Date 2008-12-15.19:27:45
SpamBayes Score 7.11987e-08
Marked as misclassified No
Message-id <1229369266.17.0.466863553252.issue1166@psf.upfronthosting.co.za>
In-reply-to
Content
I was finally able to reproduce this by manually setting a file to a 
huge timestamp. I later realized 64 bit CPython also allowed me to set 
these huge timestamps. This seemed to only work on Linux, other OSes I 
tried overflow back to smaller values

So the question is, who set the huge mtime value in the first place? 
Likely Jython -- but how? We already knew utimes had some issues on 64 
bit platforms, but how would it manage to set a timestamp to such a huge 
value if it runs into "3rd arg can't be coerced to long" on those huge 
values?

I'm thinking maybe that jna-posix utimes bug we already knew about 
somehow fudged another value into a much larger timestamp value

So I've a) fixed the 64 bit utimes bug we knew about, and also b) fixed 
utimes to allow setting these huge timestamps (as 64 bit CPython also 
allows it). So hopefully a) solves fudging timestamps, if we were in 
fact doing it before, and b) allows fudged timestamps to just pass on 
through. r5768

pjenvey@lamp:~/src/jython$ ll /tmp/foo.test 
-rw-r--r-- 1 pjenvey pjenvey 0 7165064483007524864 /tmp/foo.test
pjenvey@lamp:~/src/jython$ stat !$
stat /tmp/foo.test
  File: `/tmp/foo.test'
  Size: 0         	Blocks: 0          IO Block: 4096   regular 
empty file
Device: 801h/2049d	Inode: 78731       Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/ pjenvey)   Gid: ( 1000/ pjenvey)
Access: 7165064483007524864
Modify: 7165064483007524864
Change: 2008-12-15 00:40:34.000000000 +0000
pjenvey@lamp:~/src/jython$ touch /tmp/foo.test2
pjenvey@lamp:~/src/jython$ ll !$
ll /tmp/foo.test2
-rw-r--r-- 1 pjenvey pjenvey 0 2008-12-15 19:23 /tmp/foo.test2
pjenvey@lamp:~/src/jython$ dist/bin/jython
Jython 2.5b0+ (trunk:5768, Dec 15 2008, 19:21:04) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on 
java1.6.0_07
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.stat('/tmp/foo.test').st_mtime
7165064483007524864L
>>> os.utime('/tmp/foo.test2', (_, _))
>>> 
pjenvey@lamp:~/src/jython$ !-2
ll /tmp/foo.test2
-rw-r--r-- 1 pjenvey pjenvey 0 7165064483007524864 /tmp/foo.test2
History
Date User Action Args
2008-12-15 19:27:46pjenveysetmessageid: <1229369266.17.0.466863553252.issue1166@psf.upfronthosting.co.za>
2008-12-15 19:27:46pjenveysetrecipients: + pjenvey, fwierzbicki, thijs, worlddominationkites
2008-12-15 19:27:46pjenveylinkissue1166 messages
2008-12-15 19:27:45pjenveycreate