Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@marcelometal
Copy link
Member

@marcelometal marcelometal commented May 9, 2025

I ran the following command to remove the #!/usr/bin/python shebang from the first line of files with permissions 644 or 664:

find . -type f \( -perm 644 -o -perm 664 \) -exec sed -i '1{/^#!\/usr\/bin\/python$/d}' {} \;

Only one file tests/test_point.py was left unchanged because it had the shebang commented out:

# #!/usr/bin/python

I removed it manually.

Then, I updated the permissions to 755 for Python files that are executable (i.e., those containing if __name__ == "__main__"):

chmod 755 thumbor/server.py
chmod 755 thumbor/config.py
chmod 755 thumbor/doctor.py
chmod 755 thumbor/url_composer.py

@coveralls
Copy link

coveralls commented May 9, 2025

Pull Request Test Coverage Report for Build 14935663295

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.093%

Totals Coverage Status
Change from base Build 14935659620: 0.0%
Covered Lines: 3888
Relevant Lines: 4364

💛 - Coveralls

@marcelometal marcelometal changed the title Remove shebang from non-executable Python files WIP: Remove shebang from non-executable Python files May 9, 2025
@marcelometal marcelometal changed the title WIP: Remove shebang from non-executable Python files Remove shebang from non-executable Python files May 9, 2025
Copy link
Member

@RaphaelVRossi RaphaelVRossi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔪

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2025

@marcelometal marcelometal merged commit 161e883 into master May 9, 2025
27 checks passed
@marcelometal marcelometal deleted the shebang branch May 15, 2025 16:25
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.

4 participants