Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip not removing pkg dirs that contain __pycache__ dirs #638

Closed
qwcode opened this issue Aug 15, 2012 · 6 comments
Closed

pip not removing pkg dirs that contain __pycache__ dirs #638

qwcode opened this issue Aug 15, 2012 · 6 comments
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@qwcode
Copy link
Contributor

qwcode commented Aug 15, 2012

the tip version of pip is not removing pkg dirs that contain __pycache__ dirs

see pull #637 where I generate a failure for py32 by adding an import that generates the __pycache__ folder before the uninstall is attempted.

a similar issue came up for the debian package of pypy (that travis uses) which patches pypy to generate __pycache__ folders. there's currently a workaround for that case (see #630). possibly, we can fix both of these cases with one general fix.

I don't see this behavior locally using pip1.1 with py32, so something changed, but not sure what yet.

pip is attempting to remove the pkg using installed-files.txt which is generated using setup.py install with --record combined with --single-version-externally-managed. The log just contains inline *.pyc files. If you trace it down, you find what's ultimately being called to generate the compiled filenames is:
setuptools.command.install_lib._bytecode_filenames which has no __pycache__ awareness.

@qwcode
Copy link
Contributor Author

qwcode commented Aug 16, 2012

important discussion related to this: http://bugs.python.org/issue11254

@qwcode
Copy link
Contributor Author

qwcode commented Aug 17, 2012

posted question to distutils list to get some context:
http://mail.python.org/pipermail/distutils-sig/2012-August/018825.html

waiting to see if people have input.

@qwcode
Copy link
Contributor Author

qwcode commented Aug 18, 2012

getting the byte-compiled filename in 3.2+
http://docs.python.org/py3k/library/imp.html?highlight=imp#imp.cache_from_source
"if path is /foo/bar/baz.py the return value would be /foo/bar/__pycache__/baz.cpython-32.pyc"

the debian patched version of pypy also has imp.cache_from_source

so I think the the fix here is just generalizing the workaround we already have for debian pypy (#630) to use imp.cache_from_source

@qwcode
Copy link
Contributor Author

qwcode commented Aug 18, 2012

btw, the change from pip1.1 that exposed this is pull #437, which I think is a good change.

@qwcode
Copy link
Contributor Author

qwcode commented Aug 18, 2012

FYI, a pull is in the works for this.

jezdez added a commit that referenced this issue Aug 27, 2012
fix for #638  (__pycache__ file removal)
@jezdez jezdez closed this as completed Aug 27, 2012
@pradyunsg pradyunsg removed !release blocker Hold a release until this is resolved labels Feb 8, 2019
@lock
Copy link

lock bot commented May 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants