Gentoo Archives: gentoo-user

From: eroen <eroen@××××××××××××.eu>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: cdnpayroll.py
Date: Sun, 26 Jan 2014 11:45:37
Message-Id: 20140126124317.1e908dab@falcon.eroen.eu
In Reply to: Re: [gentoo-user] cdnpayroll.py by Joseph
1 On Sat, 25 Jan 2014 19:10:49 -0700, Joseph <syscon780@×××××.com> wrote:
2 > On 01/25/14 14:21, David Abbott wrote:
3 > >On Sat, Jan 25, 2014 at 1:15 PM, Joseph <syscon780@×××××.com> wrote:
4 > >> File "./cdnpayroll.py", line 1328
5 > >> ^
6 > >> SyntaxError: EOF while scanning triple-quoted string literal
7 > >
8 > >Try changing the shebang from:to
9 > >#!/usr/bin/python /#!/usr/bin/python2
10 >
11 > Thanks David, that was it. It should be /#!/usr/bin/python2
12 >
13
14 Alternatively, you can make the /usr/bin/python symlink point to a
15 python2 implementation with eg.
16 eselect python set python2.7
17
18 I do this on most of my systems, since there are still a lot of old
19 python scripts, that used to be valid in every way until python3 came
20 around, that assume 'python' is compatible with python2. Several
21 packages in Gentoo still have build failures due to this, although their
22 numbers are dwindling.
23
24 Also, scripts written for python3 that are incompatible with earlier
25 implementations should (IMO) be expected to declare a more specific
26 shebang.
27
28
29 PS: for completeness' sake, the /usr/bin/python2 and ...3 symlinks
30 can be changed with the --python2 and --python3 arguments after 'set'
31 in the eselect command. Available implementations can be listed with
32 eselect python list
33 which also optionally takes the --python2 and --python3 arguments.
34
35 --
36 eroen

Attachments

File name MIME type
signature.asc application/pgp-signature