Stop failing sitecustomize if cellar not in path #18338

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@deiga
deiga commented Mar 8, 2013

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

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

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)
@deiga
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 :)

@samueljohn

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.

@deiga
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

@samueljohn

will be addressed by #18588.

@samueljohn samueljohn added a commit that closed this pull request Apr 7, 2013
@deiga deiga 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>
10ba101
@samueljohn samueljohn closed this in 10ba101 Apr 7, 2013
@samueljohn

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

@samueljohn

Thank you!

@samueljohn samueljohn was assigned Apr 7, 2013
@deiga deiga deleted the deiga:patch-1 branch Apr 7, 2013
@nesv nesv added a commit to nesv/homebrew that referenced this pull request Apr 12, 2013
@deiga deiga 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>
5366329
@dshean dshean added a commit to dshean/homebrew that referenced this pull request Sep 24, 2013
@deiga deiga 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>
aafa223
@draftycode draftycode added a commit to draftycode/homebrew that referenced this pull request Feb 24, 2014
@deiga deiga 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>
cb1494d
@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.