Skip to content
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

bpo-41626: port shebang of tools from python2 to python3 #21948

Closed
wants to merge 3 commits into from

Conversation

shihai1991
Copy link
Member

@shihai1991 shihai1991 commented Aug 24, 2020

@shihai1991 shihai1991 requested review from lysnikolaou, pablogsal, tiran and a team as code owners Aug 24, 2020
@shihai1991 shihai1991 changed the title port shebang of tools from python2 to python3 bpo-41626: port shebang of tools from python2 to python3 Aug 24, 2020
Tools/pynche/pynche Outdated Show resolved Hide resolved
4383
4383 approved these changes Aug 28, 2020
Copy link
Contributor

@4383 4383 left a comment

LGTM

@merwok
Copy link
Member

merwok commented Oct 21, 2020

This is being discussed at the core sprint; it is not clear if these shebangs are actually wanted.

@ned-deily
Copy link
Member

ned-deily commented Oct 21, 2020

I don't think we should make this change. Depending on shebang lines and shell PATHs to invoke the right instance of Python is too fragile. In general, we are moving away from things like that. Explicit is better! Short of removing the shebang lines altogether, I would support standardizing on /usr/bin/env python which gives some opportunity to influence the interpreter choice on some systems but mainly to serve as a historical marker.

@ned-deily
Copy link
Member

ned-deily commented Oct 21, 2020

Also python means Python 3 on some systems.

@merwok
Copy link
Member

merwok commented Oct 21, 2020

I dug a little and wrote some findings on the ticket.

@shihai1991
Copy link
Member Author

shihai1991 commented Oct 22, 2020

Also python means Python 3 on some systems.

Oh, I don't realize this user case~

@terryjreedy
Copy link
Member

terryjreedy commented Oct 22, 2020

The use of #! in both stdlib and tools is rather inconsistent. Stdlib modules are best run with <python> -m mod so as to run the code with the exact python binary they are meant for. So I think the marker should be removed at least from /Lib/*. With 2.7 put to bed, I don't think the other are needed either. In any case, the behavior of Windows' py.exe w/r/t #1 should be looked at.

@merwok
Copy link
Member

merwok commented Oct 22, 2020

Please add these thoughts on the ticket!

@shihai1991
Copy link
Member Author

shihai1991 commented Nov 30, 2020

As the eric said in https://bugs.python.org/issue41626#msg379244. I will use some other seperated PRs to repalce this one. Thanks.

@shihai1991 shihai1991 closed this Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants