[issue12843] file object read* methods in append mode overflows

2011-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: You should call the .flush() method when switching from writes to reads. Nothing really overflows, but the fread() function may return uninitialized memory. In versions 2.x, python uses the fopen, fread and fwrite function (from the C library) and is s

[issue12843] file object read* methods in append mode overflows

2011-08-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: > I have confirmed that this only happens in windows. This would literally mean that you tested on several other systems. Did you actually mean 'I have only confirmed that this happens in Windows.", that you only tested on Windows? The 2.6 series is in secur

[issue12843] file object read* methods in append mode overflows

2011-08-25 Thread Otacon Karurosu
Otacon Karurosu added the comment: I have confirmed that this only happens in windows. -- components: +Windows ___ Python tracker ___ ___

[issue12843] file object read* methods in append mode overflows

2011-08-25 Thread Otacon Karurosu
New submission from Otacon Karurosu : When opening a file in append mode and attempting to read after doing a write operation causes the read method to overflow and read memory directly (instead of returning an empty string) The following code prints garbage: f2 = open("test", "w+b") f2.write