[pypy-dev] What's wrong with >>> open(?xxx?, ?w?).write(?stuff?) ?

William Leslie william.leslie.ttg at gmail.com
Fri Aug 20 12:32:34 CEST 2010


It seems you too have missed the difference between deleting some reference
to the object (as del does) and finalising.

On 20/08/2010 8:23 PM, "Donny Viszneki" <donny.viszneki at gmail.com> wrote:

Armin: Sakesun used "del f" and it appears you did not. In Python
IIRC, an explicit call to del should kick off the finalizer to flush
and close the file!

open('x', 'w').write('hello') alone does not imply the file instance
(return value of open()) has been finalized because the garbage
collector may not have hit it yet.

Jython and IronPython are pretty much guaranteed to behave differently
under a wide variety of circumstances when it comes to the garbage
collector. Do not rely on the garbage collector for program semantics!

Because Sakesun has used "del f" it should be quite a concern that the
file has not been finalized properly!


On Fri, Aug 20, 2010 at 5:57 AM, Armin Rigo <arigo at tunes.org> wrote:
> Hi Sakesun,
>
> On Thu, Aug ...
--
http://codebad.com/

_______________________________________________
pypy-dev at codespeak.net
http://codespeak.net/mailman/...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20100820/43eabd16/attachment.html>


More information about the Pypy-dev mailing list