#1040: manage.py should have shebang and +x permissions -------------------------------------------+---------------------- Reporter: pb@… | Owner: adrian Status: reopened | Milestone: Component: django-admin.py | Version: SVN Resolution: | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | -------------------------------------------+----------------------
Comment (by anonymous): Replying to [comment:5 lukeplant]: > Sorry, I can now see what you are talking about. My bad. I was in a bit of a rush when I wrote that report, so it probably wasn't very clear. >However, I'm not sure this is a regression - having just checked Django 1.2 and 1.0, I don't think the executable bit has ever been set correctly in this case. Okay. Seemed similar, but wasn't sure if it was best to open a new ticket, or just reuse this one. They're kinda the same use-case, i.e. being able to type `./manage.py <args>` rather than `python manage.py <args>`. Replying to [comment:6 ramiro]: > Do note that e.g. part one of the Tutorial uses `python manage.py <command>`... Presumably just for Windows-compatibility. > [http://docs.python.org/distutils/sourcedist.html Python docs] say nothing about executable permission of files that aren't listed in the `scripts` setup.py section. Perhaps it isn't possible at all? Just found [http://bugs.python.org/issue5300 an issue report] for distutils about this. Adding it into `scripts` isn't gonna help, e.g. with `django-admin.py`... {{{ -rwxr-xr-x 1 root root 124 2011-03-23 11:10 /usr/local/bin/django- admin.py -rw-r--r-- 1 root root 128 2006-12-30 06:25 /usr/local/lib/python2.6 /dist-packages/django/bin/django-admin.py }}} ...it only affects the copy which ends up in the `bin` directory - the copy in `lib` still gets execute permissions stripped. There's also another feature of files mentioned in `scripts`, which is that the shebang line is modified to point to the path returned by `which python`, which won't be applied to `manage.py`, although, TBH, I'd prefer they just left as `/usr/bin/env python` which I generally find more portable, but that's a whole different issue. Choices would seem to be... 1. Ignore until distutils provides the necessary flexibility 2. Implement custom post-processing in `setup.py` ...although I can imagine option 2 being a bit of a pain from a cross- platform POV. IMO option 1 is completely acceptable, since this is all kinda trivial really - it's just a nicety so that Unix-like OS users can save a few keystrokes, and it's not as if it's that difficult for the user to just type `chmod +x manage.py`. :-) If you do decide to go with option 1, it might be worth making a note in the docs to that effect. -- Ticket URL: <http://code.djangoproject.com/ticket/1040#comment:7> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.