[pypy-dev] Sandbox - os. functions remove, rename and others?

Søren Laursen sl at scrooge.dk
Sun Apr 25 15:14:56 CEST 2010

Hi all,

I have more or less implemented a  read/write filesystem in pypy sandbox.
Right now I am extending it with

os functions.

For example os.rename and os.remove.

I have followed the direction, that is extend sandlib.py and vfs.py files
with the new functions a la

def do_ll_os__ll_os_remove


def do_ll_os__ll_os_rename

But I get an error when running a small test:

import os

os.remove( "aFil" )


os.remove( "aFil" )

RuntimeError: internal error: <RuntimeError object at 0x872e798>

[Subprocess exit code: 1]

To verify that I understand the design correct, I added  a new listdir

do_ll_os__ll_os_listsdir(self, vpathname):

It is a copy paste from the original: do_ll_os__ll_os_listdir(self,

This also gives an error, but it is different:

for file in os.listsdir('.'):

AttributeError: 'module' object has no attribute 'listsdir'

I interpreted that, as I need, somewhere to define that I have implemented
the remove function to the sandbox. The new listsdir is not defined in the
os module, as expected.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20100425/d1a19ee8/attachment.html>

More information about the Pypy-dev mailing list