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

Add proper shebangs to all Python scripts #197

Merged
merged 1 commit into from
Apr 22, 2013
Merged

Add proper shebangs to all Python scripts #197

merged 1 commit into from
Apr 22, 2013

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Apr 21, 2013

Currently, some of the scripts don't have a shebang at all, some others have it pointing towards /usr/local/bin/python. With this patch, all shebangs use /usr/bin/env python consistently.

@wiredfool
Copy link
Member

The current situation is certainly suboptimal.

There's been previous discussion of this in issue #167. This should work on the builtin pythons for linux, I'm unclear on the effects in a virtualenv, especially if pillow has been installed for the system python but not in the virutalenv. I'm also concerned about the effect on windows. @cgohlke: Can you comment on that?

@mgorny
Copy link
Contributor Author

mgorny commented Apr 21, 2013

Well, I'm not really into virtualenv but I think it should work properly. At least I didn't hear of anything failing because of it, and I guess it's common enough shebang to have been well-tested.

As for Windows, I don't know of any thing that would fail. Considering that Windows either doesn't use shebangs (native) or uses a virtual env like MinGW or Cygwin, it should all work fine.

@wiredfool
Copy link
Member

The thing that concerns me with virtual env is that /usr/bin/env python will be from within the virtual env, but the scripts will be from the system python (or system python3) installation. I'm pretty sure that running the scripts will fail in that case.

Also, is /usr/bin/env python going to work at all if we've only been installed under python3?

@mgorny
Copy link
Contributor Author

mgorny commented Apr 21, 2013

Firstly, I'd like to note that distutils changes shebangs when it installs scripts. Therefore, the scripts which I env python here, end up being installed with full path to the Python interpreter:

$ head -1 /tmp/z/usr/bin/pilfont.py
#!/usr/bin/python2.7

However, if the script has no shebang, it will be installed with no shebang at all. That's the main reason I'd like them all to have valid shebang

@wiredfool
Copy link
Member

Oh, if distutils rewrites them, then I'm a lot happier with whatever we put in there.

@wiredfool
Copy link
Member

Looks like it works with virtualenv, If debian and fedora have issues with it, we can deal with it in the packaging. (at least for debian.)

wiredfool added a commit that referenced this pull request Apr 22, 2013
Add /usr/bin/env python shebangs to all scripts in /Scripts.
@wiredfool wiredfool merged commit 6bf7599 into python-pillow:master Apr 22, 2013
@radarhere radarhere changed the title Add proper shebangs to all Python scripts. Add proper shebangs to all Python scripts Jul 12, 2023
radarhere pushed a commit to radarhere/Pillow that referenced this pull request Sep 24, 2023
Do not use libtiff 4.3.0 on macOS 11 builds
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.

None yet

2 participants