Gentoo Archives: gentoo-user

From: Mike Edenfield <kutulu@××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] bash stopped running python scripts...
Date: Mon, 03 Aug 2009 21:22:30
Message-Id: 4A775500.8040803@kutulu.org
In Reply to: Re: [gentoo-user] bash stopped running python scripts... by Alan McKinnon
1 On 8/3/2009 5:03 PM, Alan McKinnon wrote:
2 > On Monday 03 August 2009 22:56:51 Mike Edenfield wrote:
3
4 >> kutulu@apollo ~ $ cat test.py
5 >> #!/usr/bin/python
6 >> import sys
7 >> print "Python Ok."
8 >> kutulu@apollo ~ $ ./test.py
9 >> X connection to localhost:11.0 broken (explicit kill or server shutdown).
10 >> ./test.py: line 3: print: command not found
11 >> kutulu@apollo ~ $ python ./test.py
12 >> Python Ok.
13 >> kutulu@apollo ~ $
14
15 > Did you recently merge python-3 and were so foolish as to make it the
16 > default?
17
18 I did emerge python-3, but then unmerged it almost immediately, and it
19 was never the default. Python was already broken when I merged python
20 3.1, which I did to see if it fixed anything, which of course it didn't.
21
22 > What is /usr/bin/python? and what version is it (-V)?
23
24 root@apollo ~ # /usr/bin/python -V
25 Python 2.6.2
26 root@apollo ~ # cat /usr/bin/python
27 #!/bin/bash
28 # Gentoo Python wrapper script
29
30 [[ "${EPYTHON}" =~ (/|^python$) ]] && EPYTHON="python2.6"
31 "${0%/*}/${EPYTHON:-python2.6}" "$@"
32
33 Is that supposed to be that way? I vaguely recall from my Tcl days that
34 tclsh used to cause problems with the #! lines when it was a shell
35 script, and that you had to use some odd exec trick to get tcl shell
36 scripts to run. Is that still true?
37
38 Looking back through my emerge.log it appears that the last thing to
39 successfully run through emerge was eselect-python, if that makes a
40 difference.
41
42 --Mike

Replies

Subject Author
Re: [gentoo-user] bash stopped running python scripts... Alan McKinnon <alan.mckinnon@×××××.com>