[issue6939] shadows around the io truncate() semantics

Pascal Chambon report at bugs.python.org
Tue Jan 5 20:27:11 CET 2010


Pascal Chambon <chambon.pascal at gmail.com> added the comment:

Hello

I'm currently finalizing the API of my raw io file implementation, but I still have trouble with the trunk implementation of IOBase.truncate().

If I remember well, in the mailing list topic on this subject, GvR noted that this change of behaviour compared to python 2.x was not intended, and that it would be better to get back to the expected behaviour - not touching the file pointer - and to document the method in this way.

Are there new elements, advocating a status quo on this matter ?
Or shouldn't we add the portable_lseek() call in fileio.c to fix that ?

On a separate note, I'm confused about the "at most" phrase in the current documentation :
---
truncate(size=None)
    Truncate the file to at most size bytes. size defaults to the current file position, as returned by tell()
---
According to what I've read so far, a succesful truncate() call will always extend/reduce the file until teh desired size, isn't that so on all platforms ?

Regards 
Pascal

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6939>
_______________________________________


More information about the Python-bugs-list mailing list