you all think the proper fix is for me to put in the docs something like "on Arch systems you need to do [x] before building", whether [x] is "get the PKGBUILD with the patch from AUR" or even "run the sed-python-with-python2.sh included in the distribution".
I personally don't think it is a proper fix - I think it is not a fix at all. My opinion is that Python3 is sufficiently different from Python2 to be considered a new language, not just a new version of old (thus it would be appropriate to use new name, 'python3', for it, leaving 'python' forever referring to python2). (That is, desire to be on the bleeding edge does not warrant breaking existing software)
If I were you, I would probably stop putting shebangs into my Python scripts (so that they would be not executables), and write a shell wrapper script for every python script that figures out during runtime how python2 executable is called, and call python2 script using this python executables (or write single script with symbolic links to it with different names and use $0 shell variable to find which python script to call).
Or use #!/usr/bin/env python2. This should fix problems like python2 being in a different path among distribution. On 15 December 2011 17:51, Alex Bolgarov alex@bolgarov.org wrote:>> you all think the proper fix is for>> me to put in the docs something like "on Arch systems you need to do>> [x] before building", whether [x] is "get the PKGBUILD with the patch>> from AUR" or even "run the sed-python-with-python2.sh included in the>> distribution".>> I personally don't think it is a proper fix - I think it is not a fix> at all. My opinion is that Python3 is sufficiently different from> Python2 to be considered a new language, not just a new version of old> (thus it would be appropriate to use new name, 'python3', for it,> leaving 'python' forever referring to python2). (That is, desire to be> on the bleeding edge does not warrant breaking existing software)>> If I were you, I would probably stop putting shebangs into my Python> scripts (so that they would be not executables), and write a shell> wrapper script for every python script that figures out during runtime> how python2 executable is called, and call python2 script using this> python executables (or write single script with symbolic links to it> with different names and use $0 shell variable to find which python> script to call).
Sorry I meant 'in a different path among distributions'. Forgot to double-check.
On 15 December 2011 17:56, Thanasis Georgiou sakisds.s@gmail.com wrote:
Or use #!/usr/bin/env python2. This should fix problems like python2 being in a different path among distribution.
+1 to archlinux initiative. Someone has to be the first and as always arch is there. Actually python, read python3, as default is one of the reasons I use arch. Hector
On 15 December 2011 17:58, Thanasis Georgiou sakisds.s@gmail.com wrote:
Sorry I meant 'in a different path among distributions'. Forgot to double-check.
On 15 December 2011 17:56, Thanasis Georgiou sakisds.s@gmail.com wrote:
Or use #!/usr/bin/env python2. This should fix problems like python2 being in a different path among distribution.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 15/12/11 14:20, Hector Martinez-Seara wrote:
+1 to archlinux initiative. Someone has to be the first and as always arch is there. Actually python, read python3, as default is one of the reasons I use arch. Hector
On 15 December 2011 17:58, Thanasis Georgiou sakisds.s@gmail.com wrote:
Sorry I meant 'in a different path among distributions'. Forgot to double-check.
On 15 December 2011 17:56, Thanasis Georgiou sakisds.s@gmail.com wrote:
Or use #!/usr/bin/env python2. This should fix problems like python2 being in a different path among distribution.
Guys (Thanasis and Hector),
I beg you, stop the top-posting, it's hard to understand the whole thread when you do that .... thing.
Thanks.
- -- Angel Velásquez angvp @ irc.freenode.net Arch Linux Developer / Trusted User Linux Counter: #359909 http://www.angvp.com
On Thu, Dec 15, 2011 at 9:51 AM, Alex Bolgarov alex@bolgarov.org wrote:
you all think the proper fix is for me to put in the docs something like "on Arch systems you need to do [x] before building", whether [x] is "get the PKGBUILD with the patch from AUR" or even "run the sed-python-with-python2.sh included in the distribution".
I personally don't think it is a proper fix - I think it is not a fix at all. My opinion is that Python3 is sufficiently different from Python2 to be considered a new language, not just a new version of old (thus it would be appropriate to use new name, 'python3', for it, leaving 'python' forever referring to python2). (That is, desire to be on the bleeding edge does not warrant breaking existing software)
http://mail.python.org/pipermail/python-dev/2011-March/108562.html
... the thread starts here:
http://mail.python.org/pipermail/python-dev/2011-March/108491.html
... if it hasn't been linked already. that discussion led to the aforementioned PEP, and was generally well-received (hence creation of the PEP).
If I were you, I would probably stop putting shebangs into my Python scripts (so that they would be not executables), and write a shell wrapper script for every python script that figures out during runtime how python2 executable is called, and call python2 script using this python executables (or write single script with symbolic links to it with different names and use $0 shell variable to find which python script to call).
you can factor out pieces into separate files and selectively import based on various criteria, like any other module. create an small bootstrap file that is python2/3 compatible and either run/import according to the binary you're running under, or re-exec under a different one (slightly rude form a user's perspective, but possible).
a little funky, but you can test syntax using eval:
http://stackoverflow.com/questions/446052/python-best-way-to-check-for-pytho...
... and catch SyntaxError.
per:
http://mail.python.org/pipermail/python-dev/2011-March/108495.html http://mail.python.org/pipermail/python-dev/2011-March/108499.html
... not sure if that's changed, but Arch isn't alone ... there was an incubation period of a couple years, until 3.2 release, for applications/libraries to catch up. python3 is here now, so let's give her a big welcome, and move on ;-)
take a look at the kedpm PKGBUILD [1], the package have /usr/bin/python as shebang, but if you run:
python2 setup.py
the script will automatically fix the shebangs to /usr/bin/python2 before installing
** [1] https://aur.archlinux.org/packages/ke/kedpm/PKGBUILD
On Fri, Dec 16, 2011 at 5:30 AM, C Anthony Risinger anthony@xtfx.me wrote:
On Thu, Dec 15, 2011 at 9:51 AM, Alex Bolgarov alex@bolgarov.org wrote:
you all think the proper fix is for me to put in the docs something like "on Arch systems you need to do [x] before building", whether [x] is "get the PKGBUILD with the patch from AUR" or even "run the sed-python-with-python2.sh included in the distribution".
I personally don't think it is a proper fix - I think it is not a fix at all. My opinion is that Python3 is sufficiently different from Python2 to be considered a new language, not just a new version of old (thus it would be appropriate to use new name, 'python3', for it, leaving 'python' forever referring to python2). (That is, desire to be on the bleeding edge does not warrant breaking existing software)
http://mail.python.org/pipermail/python-dev/2011-March/108562.html
... the thread starts here:
http://mail.python.org/pipermail/python-dev/2011-March/108491.html
... if it hasn't been linked already. that discussion led to the aforementioned PEP, and was generally well-received (hence creation of the PEP).
If I were you, I would probably stop putting shebangs into my Python scripts (so that they would be not executables), and write a shell wrapper script for every python script that figures out during runtime how python2 executable is called, and call python2 script using this python executables (or write single script with symbolic links to it with different names and use $0 shell variable to find which python script to call).
you can factor out pieces into separate files and selectively import based on various criteria, like any other module. create an small bootstrap file that is python2/3 compatible and either run/import according to the binary you're running under, or re-exec under a different one (slightly rude form a user's perspective, but possible).
a little funky, but you can test syntax using eval:
http://stackoverflow.com/questions/446052/python-best-way-to-check-for-pytho...
... and catch SyntaxError.
per:
http://mail.python.org/pipermail/python-dev/2011-March/108495.html http://mail.python.org/pipermail/python-dev/2011-March/108499.html
... not sure if that's changed, but Arch isn't alone ... there was an incubation period of a couple years, until 3.2 release, for applications/libraries to catch up. python3 is here now, so let's give her a big welcome, and move on ;-)
--
C Anthony
arch-general@lists.archlinux.org