Issue #121 resolved

SandboxViolation on Python 3 building setup_requires deps when lib2to3 grammar is not writable

Jason R. Coombs
created an issue

Consider an environment such as this one on Windows where the system site-packages is not writable (due to UAC restrictions) and the lib2to3 grammar pickles aren't yet generated:

C:\Users\jaraco>easy_install --user irc
Searching for irc
Best match: irc 8.5.4
Writing C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\setup
Running irc-8.5.4\ -q bdist_egg --dist-dir C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\egg-dist-tmp-uo7m2_qf
Searching for pytest-runner
Best match: pytest-runner 2.0
Writing C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\temp\easy_install-wwlag15y\pytest-runner-2.0\setup.cfg
Running pytest-runner-2.0\ -q bdist_egg --dist-dir C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\temp\easy_install-wwlag15y\pytest-runner-2.0\egg-dist-tmp-oycl4frc
Searching for hgtools
Best match: hgtools 4.0
Writing C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\temp\easy_install-wwlag15y\pytest-runner-2.0\temp\easy_install-ozih9t6e\hgtools-4.0\setup.cfg
Running hgtools-4.0\ -q bdist_egg --dist-dir C:\Users\jaraco\AppData\Local\Temp\easy_install-_g5bf6xb\irc-8.5.4\temp\easy_install-wwlag15y\pytest-runner-2.0\temp\easy_install-ozih9t6e\hgtools-4.0\egg-dist-tmp-rrwg3yo6
error: Setup script exited with error: SandboxViolation: open('c:\\python\\lib\\lib2to3\\Grammar3.4.0.beta.1.pickle', 'wb') {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

Easy_install can install simple packages that have no setup_requires dependencies, but when setuptools encounters a package with setup_requires dependencies, those dependencies are built in a sandbox which will trigger a violation when lib2to3 attempts to cache the grammar in a pickle.

Comments (1)

  1. Log in to comment