[issue6939] shadows around the io truncate() semantics

Pascal Chambon report at bugs.python.org
Sat Jan 16 13:09:59 CET 2010


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

Thanks for the detailed feedback.

According to what you said (and to details found in python docs), the current _fileio.truncate is actually quite buggy -> no reference counting ops were done on posobj, even though it's sometimes retrieved from _portable_seek, and returned or not depending on rare error cases (SetEndOfFile failing etc.).

Here is a patch fixing all that for python2.6, I've tested it manually in debug mode, and against memoryio/io/fileio tests ; hope it will be OK.

As soon as this one is certified, I'll prepare a patch for python2.7

----------
Added file: http://bugs.python.org/file15909/patch26_truncate_pos_refcounts.patch

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


More information about the Python-bugs-list mailing list