pombreda / txt2tags

Automatically exported from code.google.com/p/txt2tags
GNU General Public License v2.0
0 stars 0 forks source link

python when python3 is the default system #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On some Linux systems (for example Archlinux), python3 is the default
2. A call to python will start the python 3 interpreter, while python 2 is 
called with "python2".

What is the expected output? What do you see instead?
When running txt2tags with python 3 we get some errors ("SyntaxError: invalid 
syntax")

Please use labels and text to provide additional information.

Python 3 was released at the end of 2008 and is considered the default by 
python.org: "At the time of writing (July 4, 2010), the final 2.7 release is 
out, with a statement of extended support for this end-of-life release. The 2.x 
branch will see no new major releases after that. 3.x is under active 
development and has already seen stable releases, such as the recent 3.2. This 
means that all recent standard library improvements, for example, are only 
available in Python 3.x."
http://wiki.python.org/moin/Python2orPython3

On archlinux, the packager changed 
#!/usr/bin/env python

to 
#!/usr/bin/env python2

but for windows users, for example, they don't have a clue why it's not working.

Would it be possible to test (maybe not each time, but in case of error) if a 
"python2" binary is available, or if only python 3 is available, and adapt 
txt2tags behavior according to this.

For example, in my makefile, I've added this code:

ifeq ($(wildcard /usr/bin/python2),)
 PYTHONVER = python 
else 
 PYTHONVER = python2
endif

TXT2TAGS = $(PYTHONVER) $(PATHTOTXT2TAGS)/txt2tags

Original issue reported on code.google.com by eforg...@gmail.com on 29 May 2012 at 7:56

GoogleCodeExporter commented 9 years ago
This may be of interest here: 
http://pymolurus.blogspot.de/2012/07/python-launcher-brings-shebang-line.html

Original comment by jendriks...@gmail.com on 26 Jul 2012 at 10:15