Bug#737376: texlive-extra-utils: Debian pythontex can't use python3
Package: texlive-extra-utils
Version: 2013.20131219-1
Tags: patch
I just read about pythontex in TUGboat - it sounds great!
I was a little surprised that it says, though, that it's only for
Python 2.7. So I looked at the code, and it has support for Python
3.2+; yay! Unfortunately, though, the invocation doesn't allow this
to work on Debian: /usr/bin/pythontex ->
/usr/share/texlive/texmf-dist/scripts/pythontex/pythontex.py
has the first line:
#!/usr/bin/env python
and on Debian, /usr/bin/python is a symlink to python2.7, so the rest
of the pythontex.py code, which checks whether python2 or python3 is
being used, is effectively redundant.
My suggested patch is as follows:
Create a copy of pythontex.py in
/usr/share/texlive/texmf-dist/scripts/pythontex, called say
pythontex3-init.py (pythontex3.py is already used), which has the
first line
#!/usr/bin/python3
or
#!/usr/bin/env python3
and symlink /usr/bin/pythontex3 to it.
That way, pythontex will use Python 2.7 and pythontex3 will use Python
3.x.
Julian
Reply to: