Sqlmap: python shebang instead of python2 still relevant ?

Created on 19 Feb 2018  ·  11Comments  ·  Source: sqlmapproject/sqlmap

Hi, i was wondering why the shebang is still #!/usr/bin/env python instead of #!/usr/bin/env python2.

I saw the PR #1244 and #1246 , but they are from 2015, and i was wondering if the comments on them are still relevant.

support

Most helpful comment

If there will be a standard which says "use #!/usr/bin/env python2" I'll do it.

According to PEP 394:

in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line.

All 11 comments

Yup. Some people still use oldish systems. For example, out of nowhere this guys uses XP (https://github.com/sqlmapproject/sqlmap/issues/2939).

Not sure what's the problem with #!/usr/bin/env python?

p.s. I don't care about "progressive" Linux distros, like "Arch". If there will be a standard which says "use #!/usr/bin/env python2" I'll do it. Until then, Arch users can just use plain old python2 sqlmap.py

My opinion on this is that "we should be consistent with the mostly used systems in our userbase", and from what i saw, most users run sqlmap on debian or arch (but that's probably subjective).

Of course there are users running sqlmap on Windows XP or whatever old distro, but are they more common than users running sqlmap on debian, arch or ubuntu?

But this is a trivial discussion. What seems to be the problem in the first place?

"/bin/sh" vs "/bin/bash". Fight

p.s. On Debian based systems there are absolutely no problems with "/usr/bin/python". On "progressive" Arch based systems (not used by majority of users) there are problems. I would say that we are talking here about a pure subjective matter.

I think i understand your point of view and agree that distributions that have python = python3 are wrong. They shouldn't have done that, it's a huge risk.

But the facts are that some users are running those distributions, and i don't think we can ignore that, even if those distros are kinda wrong. Putting python2 as the shebang would make most users happy, independently of their Linux distro.

Anyway, this is your soft, you do what you want. I was simply wondering why. Got my answer, it's for WindowsXP users.

Not only for XP users. There are lots of VPSes around that use oldish images (e.g. oldish Debian distros) that don't know what is /usr/bin/python2

Python is Python2. Python3 is a new language. Distros should not force their "opinion" as programmers are those that make the choice in the end.

p.p.p.s. In year or so I'll change the shebang when I'll be comfortable with it (not breaking too many old system user's running compatibility)

Oops... just dit a merge request on this one... maybe now is the right time to make the change ;)

If there will be a standard which says "use #!/usr/bin/env python2" I'll do it.

According to PEP 394:

in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line.

@exploide done. Thank you for the notice/reference

Was this page helpful?
0 / 5 - 0 ratings