Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20027 closed Bug (wontfix)

manage.py shebang should reflect used python executable

Reported by: anonymous Owned by: nobody
Component: Python 3 Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,
since Django now supports both Python 2 and Python 3, it seems that shebang in generated manage.py in new projects should reflect this. Currently, manage.py always points to "python", but IMHO when generated with python3, it should point to "python3". I think it makes sense to manage a project with python version that was used to generate it.

Change History (3)

comment:1 Changed 2 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

There isn't any guarantee that the executables for Python 2 and 3 are called python and python3. They may just as well be called python2 and python.

comment:2 Changed 2 years ago by anonymous

Right, so what about using the name of the binary that was used? As in sys.executable.

comment:3 Changed 2 years ago by aaugustin

If you're going to share the code — either because it's open source, or with co-workers — this could still be a problem. (Rewriting sheebangs always causes trouble.)

The recommended way to deal with this is to create a virtualenv with the Python binary you want, and to activate it whenever your work on your Django project.

Note: See TracTickets for help on using tickets.
Back to Top