This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author psi-man
Recipients
Date 2003-09-06.13:08:25
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
>manual says file.truncate leave the pointer unmoved, 

>>> f=file('test.dat', 'wb') to make things easier
>>> f.write('1234567890')
>>> f.close()
>>> f=file('test.dat','rb+')
>>> f.read(5)
>>>'12345'
>>> f.tell()
>>>5L
>>> f.truncate()
>>> f.tell()
>>>10L


>>>( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC
v.1200 32 bit (Intel)] on win32. )


Seems it's a Windows only bug.  On a 2.4.3 linux,
libc-2.2.5 the final
statement produces 5L (and the file is only 5 bytes
long).  Same on
another 2.4.19 libc-2.2.5, and a 2.4.21 libc-2.3.1
Linux, all with a
recent Python 2.4a0 .  
reproduce on Windows.
History
Date User Action Args
2007-08-23 14:16:41adminlinkissue801631 messages
2007-08-23 14:16:41admincreate