Opened 16 years ago

Closed 11 years ago

#7762 closed New feature (fixed)

management prints full path to script when command error occurs

Reported by: miracle2k Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

PS > django-admin startapp --invalid
Usage: G:\Programme\Python\25\Scripts\django-admin.py startapp [options] [appname]

Fixed by using os.path.basename() in BaseCommand.run_from_argv.

Change History (10)

comment:1 by Malcolm Tredinnick, 16 years ago

Resolution: wontfix
Status: newclosed

That change would mean it gives the wrong results when you run it from some relative path on any Unix-derived system. The only small visual inconsistency here is that Windows gives slightly non-standard values for sys.argv[0] (the traditional return value is the path from where the command is run -- a relative path, not an absolute one). Plus, the value displayed for Windows isn't actually wrong. So I don't think this is worth doing -- replacing a correct display with something that will be incorrect in certain other situations would be a regression.

comment:2 by miracle2k, 16 years ago

Resolution: wontfix
Status: closedreopened

Hm, are you sure Malcolm? The *basename(sys.argv[0])* approach is also used in management.init when handling errors not specific to a certain command:

michael@giver:/$ /usr/bin/django-admin.py help startapp 2>&1| head -n 1
Usage: django-admin.py startapp [options] [appname]
michael@giver:/$ /usr/bin/django-admin.py startapp --invalid 2>&1| head -n 1
Usage: /usr/bin/django-admin.py startapp [options] [appname]
michael@giver:/$

That seems like an inconsistency both on Windows and *nix. basename() should return the actual filename (presumably what we would want) on all platforms.

comment:3 by Eric Holscher, 16 years ago

milestone: 1.0 maybe
Triage Stage: UnreviewedDesign decision needed

comment:4 by Jacob, 16 years ago

milestone: 1.0 maybe

comment:5 by Jacob, 16 years ago

Triage Stage: Design decision neededAccepted

comment:6 by Luke Plant, 14 years ago

Severity: Normal
Type: New feature

comment:7 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:10 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In c24e979ece2729716593291d3ebd81fdf7fc3b7d:

Fixed #7762 -- Hidden full script name in command error output

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