[Python-3000] r62195 - in python/trunk: Doc/c-api/file.rst Include/fileobject.h Lib/test/test_file.py Misc/NEWS Objects/fileobject.c

Gregory P. Smith greg at krypto.org
Wed Apr 9 21:00:16 CEST 2008


On Wed, Apr 9, 2008 at 4:10 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

>
> Christian wrote:
> > > Make file objects as thread safe as the underlying libc FILE*
> implementation.
> > > close() will now raise an IOError if any operations on the file object
> > > are currently in progress in other threads.
> > >
> > > Most code was written by Antoine Pitrou (pitrou).  Additional testing,
> > > documentation and test suite cleanup done by me (gregory.p.smith).
> > >
> > > Fixes issue 815646 and 595601 (as well as many other bugs and
> > > references to this problem dating back to the dawn of Python).
> >
> > How much of the code needs to go into Python 3000? Python 3000 exposes
> > only file descriptors and not wrapepd FILE*. It should be safe without
> > the patch, shouldn't it?
>
> If you are curious you could port the unit tests to py3k and see in
> which kinds of ways they fail :)
>
> Then we can debate whether, and how, we should make FileIO objects
> thread-safe.
>
> cheers
>
> Antoine.
>

Agreed, port the tests and watch things fail.  Since we claim file objects
are as thread safe as the underlying C library FILE* implementation in 2.6
which turns out to be pretty darn thread safe, we should try to match that
behavior in 3.0.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20080409/767137a0/attachment-0001.htm 


More information about the Python-3000 mailing list