1. Tarek Ziadé
  2. distribute
  3. Issues
Issue #118 resolved

SandboxViolation generating COM wrappers installing WMI

Jason R. Coombs
created an issue

Using distribute 0.6.10 on Windows 7 64-bit with Python 2.6.4 64-bit, I run the following command

easy_install wmi

Distribute locates http://timgolden.me.uk/python/downloads/WMI-1.4.6.zip and attempts to install it, but fails with an error:

{{{ error: SandboxViolation: mkdir('C:\Python\lib\site-packages\win32com\gen_py', 511) {}

}}}

I believe I was able to easy_install wmi under setuptools 0.6c9. This is my first attempt since long ago when I switched to distribute.

The gen_py directory is a directory created by the pywin32 package when one attempts to set up early binding for COM objects (as I suspect the WMI package is doing during setup).

I suggest maybe the gen_py directory needs to be whitelisted for the sandbox, as this issue may arise for many packages besides WMI. Please advise if another workaround or solution is more appropriate.

Comments (3)

  1. Jason R. Coombs reporter

    Is the solution to this similar to that of #101? That is, should win32com/gen_py be exempted?

    If so, I'll start by adding a unit test and then write a fix. Is there any preference for how specific the fix should be? My temptation is to just to add

    os.path.dirname(__import__('win32com.gen_py', fromlist=['__name__']).__file__)
    

    or

    os.path.join(os.path.dirname(__import__('win32com').__file__), 'gen_py')
    

    to the list of exemptions (only if it exists, of course).

    I'll work out a good way to address the problem, but I'm open to any suggestions beforehand.

  2. Log in to comment