This repository has been archived by the owner. It is now read-only.

Stop failing sitecustomize if cellar not in path #18338

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

deiga commented Mar 8, 2013

This fixes issues when calling python scripts print 'import sitecustomize' failed; use -v for traceback

Stop failing sitecustomize if cellar not in path
This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`
Contributor

samueljohn commented Mar 8, 2013

I don't know how this can happen, that your python is at HOMEBREW_PREFIX but has not HOMEBREW/Cellar in the sys.path.

Having said that, the fix looks reasonable to me. Indeed, in the upcoming python rework, I have a similar line in:

          if sys.path.startswith('#{HOMEBREW_PREFIX}/Cellar'):
              sys.path.remove(p)
Contributor

deiga commented Mar 8, 2013

yeah, I don't know either how that could have even happened, but it caused some headaches with the weird error message :)

Of course that also could be extended with an else that outputs a warning that something is wrong with the pythonpath :)

Contributor

samueljohn commented Mar 10, 2013

Did you first brew install python and then install the python from python.org (which also writes /usr/local/bin/python)?

We must not output from the sitecustomize.py, otherwise the output of executable python scripts is no longer parseable.

Contributor

deiga commented Mar 10, 2013

No, I only had system python installed and then I installed brew install python, I never downloaded python or installed from another source

Contributor

samueljohn commented Mar 19, 2013

will be addressed by #18588.

@samueljohn samueljohn closed this in 10ba101 Apr 7, 2013

Contributor

samueljohn commented Apr 7, 2013

I pulled this as a kind of hot-fix until #18588 arrives.

Contributor

samueljohn commented Apr 7, 2013

Thank you!

@ghost ghost assigned samueljohn Apr 7, 2013

@deiga deiga deleted the deiga:patch-1 branch Apr 7, 2013

nesv added a commit to nesv/homebrew that referenced this pull request Apr 12, 2013

python: sitecustomize checks path before remove
This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`

Closes #18338.

Signed-off-by: Samuel John <github@SamuelJohn.de>

dshean added a commit to dshean/homebrew that referenced this pull request Sep 24, 2013

python: sitecustomize checks path before remove
This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`

Closes #18338.

Signed-off-by: Samuel John <github@SamuelJohn.de>

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.