Skip to content

gh-118673: Remove shebang and executable bits from stdlib modules. #119658

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

Merged
merged 2 commits into from
May 29, 2024

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented May 28, 2024

Closes #118673

Note that while this change removes shebangs from many modules in the standard library, this approach does not set a precedent that shebangs are discouraged. Shebangs and executable bits are still allowed and supported in situations deemed appropriate. Some of these changes may be reverted if it is determined their presence is adding significant value.

@jaraco jaraco requested review from ethanfurman and a team as code owners May 28, 2024 13:20
@jaraco jaraco requested review from merwok and removed request for a team and ethanfurman May 28, 2024 13:29
@jaraco jaraco force-pushed the feature/no-exe-modules branch 2 times, most recently from e791199 to ac81766 Compare May 28, 2024 13:38
jaraco added 2 commits May 28, 2024 09:39
The setting was inappropriate for '__main__' and inconsistent across the other modules. The scripts can still be executed directly by invoking with the desired interpreter.
@jaraco jaraco force-pushed the feature/no-exe-modules branch from ac81766 to 97b8138 Compare May 28, 2024 13:39
@jaraco
Copy link
Member Author

jaraco commented May 29, 2024

I was unsure whether turtledemo should have its shebangs removed, as the documentation specifically states that the individual modules can be run independently. But given that (a) the files have .py extensions, (b) the non-portability of shebang invocation, (c) the fact that users can still invoke them directly with an interpreter or runpy, and (d) only some of the scripts had shebangs, I chose to remove them.

@jaraco jaraco merged commit c8b45a3 into python:main May 29, 2024
35 checks passed
@jaraco jaraco deleted the feature/no-exe-modules branch May 29, 2024 16:43
@jaraco jaraco removed the request for review from merwok May 29, 2024 16:43
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…es. (python#119658)

* pythongh-118673: Remove shebang and executable bits from stdlib modules.

* Removed shebangs and exe bits on turtledemo scripts.

The setting was inappropriate for '__main__' and inconsistent across the other modules. The scripts can still be executed directly by invoking with the desired interpreter.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…es. (python#119658)

* pythongh-118673: Remove shebang and executable bits from stdlib modules.

* Removed shebangs and exe bits on turtledemo scripts.

The setting was inappropriate for '__main__' and inconsistent across the other modules. The scripts can still be executed directly by invoking with the desired interpreter.
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.

Remove shebang and executable bit from most modules
2 participants