New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to python3 #26
Port to python3 #26
Conversation
Is the binary reliably called |
On Tue, 19 Nov 2019 18:22:11 -0800, David E. Wheeler wrote:
Is the binary reliably called `python3` on most platforms? (Sorry,
not a Python person.)
TBH: I'm not sure (not a python person either).
Going through the python docs is a bit inconclusive:
https://docs.python.org/3/tutorial/interpreter.html says it's an
"installation option" and UNIX won't use /usr/bin/python to avoid
clashes with python 2.
https://docs.python.org/3/using/unix.html and
https://docs.python.org/3/using/windows.html and
https://docs.python.org/3/using/mac.html
seem to indicate that the name of the executable can vary depending
on the choice of the installer/distributor …
So yeah, I don't know :/
I just can assume that using `python{,.exe}` is dangerous, as that
can by 2.x or 3.x.
Maybe it makes sense to first check for `python3` and then for
`python`?
Cheers,
gregor
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with a couple of minor tweaks.
lib/Text/Markup/Rest.pm
Outdated
@@ -13,7 +13,7 @@ our $VERSION = '0.24'; | |||
|
|||
# Find Python (process stolen from App::Info). | |||
my ($PYTHON, $RST2HTML); | |||
for my $exe (WIN32 ? 'python.exe' : 'python') { | |||
for my $exe (WIN32 ? 'python.exe' : 'python3') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like maybe it should be python3.exe
on Windows, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, changed in our branch.
lib/Text/Markup/rst2html_lenient.py
Outdated
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/env python | |||
#!/usr/bin/python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not #!/usr/bin/env python3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be a Debianism: We want to make sure that the binary from our system package is used (same for perl, btw). But this might not be universal, so I pushed a commit which changes the hashbang back.
In Debian we want to make sure that the binary from the system package is used, in other enviroments this might be different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
On Tue, 10 Dec 2019 14:52:35 +0000, David E. Wheeler wrote:
Looks good, thank you!
You're welcome, and thanks for merging!
|
In Debian we are currently applying the following patch to
Text-Markup.
We thought you might be interested in it too.
The patch is tracked in our Git repository at
https://salsa.debian.org/perl-team/modules/packages/libtext-markup-perl/raw/master/debian/patches/python3.patch
Thanks for considering,
gregor herrmann,
Debian Perl Group