openwall / openwall/john

"python" may point to nothing (most probable), python2 or python3 (least probable)

Open
#5,786 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

portability
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

From https://github.com/openwall/john/pull/4898#issuecomment-2960241126 on:

Me:

Um, what is the current "correct" way of calling python? Shebangs like #!/usr/bin/env python doesn't work on Ubuntu (at least not my 24.04) but some of our tools (and this one) use that, while others use #!/usr/bin/env python3 and a couple even has #!/usr/bin/env python2.

Solar:

Our conversion was to use #!/usr/bin/env python for scripts that work with either Python 2 or 3, #!/usr/bin/env python3 for scripts that are Python 3 only, and #!/usr/bin/env python2 for scripts that are Python 2 only. Unfortunately, it looks like our convention for universal script is detached from distro reality.

If so, I suggest we convert them to use #!/usr/bin/env python3 because a modern distro is unlikely to have anything else available by default, but add a comment just below saying that the script also works with Python 2.

This is especially important and unfortunate for bitcoin2john.py, which supports both versions of Python but is easier to get working with Python 2 (BDB bundled) than 3. So we may want to put a more elaborate comment into that one script.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Python script shebangs, especially bitcoin2john.py, against the stated Python 2 and Python 3 compatibility convention. Determine which scripts need updated interpreter names and where compatibility comments are required. Done means the script entry points use a working modern-distro invocation while preserving the documented compatibility guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.