Code

Opened 13 months ago

Closed 13 months ago

Last modified 13 months 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.

Attachments (0)

Change History (3)

comment:1 Changed 13 months 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 13 months ago by anonymous

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

comment:3 Changed 13 months 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.