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 vinay.sajip
Recipients Arfrever, amaury.forgeotdarc, benjamin.peterson, georg.brandl, vinay.sajip
Date 2011-06-19.20:48:40
SpamBayes Score 1.2617567e-08
Marked as misclassified No
Message-id <480952.11691.qm@web25801.mail.ukl.yahoo.com>
In-reply-to <BANLkTikOz82ah-g4wz_O5q2j+h4C6=_KOQ@mail.gmail.com>
Content
> Benjamin Peterson <benjamin@python.org> added the  comment:

> > assert(newpos != NULL)
> 
> That's because the  call is failing. Why?
> 

It's seemingly because the Python code did a seek (in Python) which was not 
communicated to the FILE object; after reading all objects from the file, a seek 
was done to the beginning to start reading again. On the previous call, the FILE 
would have been at EOF (at a C level). So it seems as if we have to call ftell 
on the Python object at the beginning of the read, and do an fseek to sync the 
positions. It's doable, of course, so it's the next thing I'll try, but what I'm 
worried about is the thing turning into a bit of a rabbit-hole.

I haven't looked at the io implementation, but for this sort of synchronisation, 
it would be better if when based on a FILE object, the io implementation 
delegated all its operations to the FILE object - but it doesn't look like 
that's the case, and I'm uncomfortable that there may be some undesirable 
consequences of that.
History
Date User Action Args
2011-06-19 20:48:41vinay.sajipsetrecipients: + vinay.sajip, georg.brandl, amaury.forgeotdarc, benjamin.peterson, Arfrever
2011-06-19 20:48:40vinay.sajiplinkissue12291 messages
2011-06-19 20:48:40vinay.sajipcreate