only stage OS X readline if it is an extension #513

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@minrk
Contributor
minrk commented Dec 14, 2013 edited

Custom readline can be readline.py, which shouldn't be staged as readline.so.

Since pip doesn't do the sys.path shenanigans that easy_install does, the readline project is considering a change where the extension is renamed to gnureadline.so, since there is no way to override a stdlib module with pip. The proposed change adds a readline.py that does from gnureadline import * for people who still expect the easy_install behavior.

With this change, imp.find_module('readline') would find readline.py, which is currently being staged as readline.so on OS X, which will not be importable, failing with:

ImportError: dlopen(VIRTUAL_ENV/lib/python2.7/readline.so, 2): no suitable image found.  Did find:
    VIRTUAL_ENV/lib/python2.7/readline.so: file too short

This PR simply excludes non-extension readline from the special handling.

Only easy_installed readline is affected, since pip installed readline will never be found by find_module('readline').

The long-term effect of this will be that users who install a site-packages readline will never have that package staged into virtualenv.

@minrk minrk only stage OS X readline if an extension
Custom readline can be readline.py, which shouldn't be staged as readline.so.
9ad9a5a
@BrownTruck

Hello!

As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the master branch. However, this Pull Request was made against the develop branch so it will need to be resubmitted against master. Unfortunately, this pull request does not cleanly merge against the current master branch.

If you do nothing, this Pull Request will be automatically closed by @BrownTruck since it cannot be merged.

If this pull request is still valid, please rebase it against master (or merge master into it) and resubmit it against the master branch, closing and referencing the original Pull Request.

If you choose to rebase/merge and resubmit this Pull Request, here is an example message that you can copy and paste:

Custom readline can be readline.py, which shouldn't be staged as readline.so.

Since pip doesn't do the sys.path shenanigans that easy_install does, the readline project is considering a change where the extension is renamed to gnureadline.so, since there is no way to override a stdlib module with pip. The proposed change adds a readline.py that does from gnureadline import * for people who still expect the easy_install behavior.

With this change, imp.find_module('readline') would find readline.py, which is currently being staged as readline.so on OS X, which will not be importable, failing with:

ImportError: dlopen(VIRTUAL_ENV/lib/python2.7/readline.so, 2): no suitable image found.  Did find:
    VIRTUAL_ENV/lib/python2.7/readline.so: file too short

This PR simply excludes non-extension readline from the special handling.

Only easy_installed readline is affected, since pip installed readline will never be found by find_module('readline').

The long-term effect of this will be that users who install a site-packages readline will never have that package staged into virtualenv.

---

*This was migrated from pypa/virtualenv#513 to reparent it to the ``master`` branch. Please see original pull request for any previous discussion.*
@BrownTruck

This Pull Request was closed because it cannot be automatically reparented to the master branch and it appears to have bit rotted.

Please feel free to re-open it or re-submit it if it is still valid and you have rebased it onto master or merged master into it.

@BrownTruck BrownTruck closed this May 26, 2016
@tdsmith tdsmith added a commit to tdsmith/brew that referenced this pull request Jul 6, 2016
@tdsmith tdsmith Don't inhale user site-packages
Avoids a bug where virtualenv picks up gnureadline's readline.py.

pypa/virtualenv#513
d202864
@tdsmith tdsmith added a commit to tdsmith/brew that referenced this pull request Jul 23, 2016
@tdsmith tdsmith Don't inhale user site-packages
Avoids a bug where virtualenv picks up gnureadline's readline.py.

pypa/virtualenv#513
0128112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment