Issue #249 resolved

2to3 fixer exemption mechanism needed

Jason R. Coombs
created an issue

Sometimes 2to3 fixers are too aggressive and need to be disabled. For example, in jaraco.util, the fix_import 2to3 fixer causes problems and is unnecessary as forward-compatible imports are already used. Therefore, the distribute 2to3 utility needs a way to disable these fixers when they cause problems.

Currently, there is no such mechanism, and the jaraco.util project addresses this by [[https://bitbucket.org/jaraco/jaraco.util/src/104e2fa6a8db/setup.py#cl-16|removing the fixers programmatically]].

Unfortunately, this technique will fail with a SandboxViolation if the lib2to3.gram module has not been previously imported (as it writes files to the lib2to3 directory on first import).

{{{ Processing jaraco.util-3.9.1.zip Running jaraco.util-3.9.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-umJccq/jaraco.util-3.9.1/egg-dist-tmp-4DDYpQ error: SandboxViolation: open('/usr/lib/python2.7/lib2to3/Grammar2.7.1.final.0.pickle', 'wb') {} }}}

If distribute had a fixer exemption mechanism, it should sidestep the SandboxViolation.

Comments (1)

  1. Log in to comment