Closed GoogleCodeExporter closed 9 years ago
This doesn't make sense. If serfmake is running /usr/bin/python, why is it
loading
/usr/local/lib/python2.5/os.py?
What is your PYTHONPATH set to?
This looks like either a mis-match between /usr/bin/python and PYTHONPATH, or a
broken install.
The "env python" approach has it's own issues. You can always explicitly call
the
right python with the script.
-Dan C
Original comment by DanChris...@gmail.com
on 27 Aug 2007 at 9:51
PYTHONPATH is set to:
{{{
/Users/prh/Python:/usr/local/lib/python2.5:/usr/local/lib/python2.5/plat-darwin:
/usr/local/lib/python2.5/
plat-darwin/MacToolbox:/usr/local/lib/python2.5/lib-tk:/usr/local/lib/python2.5/
lib-dynload:/usr/local/lib/
python2.5/site-packages
}}}
It is not a broken installation of Python; I've been using this installation of
it for months.
> You can always explicitly call the right python with the script.
Yes; I'm just not used to doing that. ☺ Especially when it's not something
Python-*related*, but simply a
command-line tool *written in* Python (which could just as well be written in
Perl or Ruby or Java or shell-
script).
The bug is not the “import site failed” error message; that's expected,
given the mismatch. The bug (a term
which I use *very* loosely here) is the mismatch itself, that the script is
written with the assumption that the
correct python is /usr/bin/python.
If `env python` is objectionable (for reasons which I assume include the
possibility of PATH attacks?), perhaps
the script could be wrapped in a shell trampoline that invokes “which
python”, then asks the user whether this
is the proper python to use.
Original comment by boredzo
on 27 Aug 2007 at 10:17
I checked with my local python expert and he says that env is a somewhat better
way
to go.
It's still not perfect. You might get a horribly old version or some weird (or
hacked) thing. This doesn't eliminate the possibility that the python and the
user's
PYTHONPATH are incompatible.
Customizing it with an installer or wrapper script is best, but that seems
painful
for a build tool.
-Dan C
Original comment by DanChris...@gmail.com
on 28 Aug 2007 at 12:28
Changed to "#!/usr/bin/env python" in r1181 as suggested here and responding to
another user's report.
Original comment by lieven.govaerts@gmail.com
on 16 Apr 2008 at 5:55
Original issue reported on code.google.com by
boredzo
on 27 Aug 2007 at 5:35