Skip to content

Update python script shebang line to python3#1336

Open
cwhite911 wants to merge 3 commits into
OSGeo:grass8from
cwhite911:bash-python3
Open

Update python script shebang line to python3#1336
cwhite911 wants to merge 3 commits into
OSGeo:grass8from
cwhite911:bash-python3

Conversation

@cwhite911

Copy link
Copy Markdown
Contributor

Updated python script shebang to enforce python3 instead of python.

@wenzeslaus

Copy link
Copy Markdown
Member

We went through these switches several times. What is the current practice? What do the distros want?

@cwhite911

Copy link
Copy Markdown
Contributor Author

What I've always thought was use python3 if you want to be explicit about not running python2.

@echoix

echoix commented Feb 20, 2025

Copy link
Copy Markdown
Member

@cwhite911

Copy link
Copy Markdown
Contributor Author

So it looks like #!/usr/bin/env python3 is the recommended version.

@echoix

echoix commented Feb 21, 2025

Copy link
Copy Markdown
Member

Also, it should only be for files intended to be run as scripts directly. Library code, imported, shouldn't be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants