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

Armin Rigo arigo at tunes.org
Fri Aug 20 11:57:21 CEST 2010


Hi Sakesun,

On Thu, Aug 19, 2010 at 11:25:42AM +0700, sakesun roykiatisak wrote:
> >>> f = open('xxx', 'w')
> >>> f.write('stuff')
> >>> del f
> 
> Also, I've tried that with both Jython and IronPython and they all work
> fine.

I guess that you didn't try exactly the same thing.  If I do:

    arigo at tannit ~ $ jython                 
    Jython 2.2.1 on java1.6.0_20
    Type "copyright", "credits" or "license" for more information.
    >>> open('x', 'w').write('hello')
    >>> 

Then "cat x" in another terminal shows an empty file.  The file "x" is
only filled when I exit Jython.  It is exactly the same behavior as I
get on PyPy.  Maybe I missed something, and there is a different way to
do things such that it works on Jython but not on PyPy; if so, can you
describe it more precisely?  Thanks!


A bientot,

Armin.



More information about the Pypy-dev mailing list