Problem with .next() method adding junk characters.

Fredrik Lundh fredrik at pythonware.com
Mon Oct 2 03:59:45 EDT 2006


"Rainy" <ak at silmarill.org> wrote:

> I'm just curious as to what's happening. I understand that you're not
> supposed to call .next on a file open for writing. But I don't know why
> and how it does what happened here; besides, I've seen the same thing
> happen before when I was doing something else with file
> open/write/close, but I don't remember the specifics.

C's stdio library require you to call "flush" when switching between reading and
writing; if you don't, the result is undefined.

</F> 






More information about the Python-list mailing list