Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22256 closed Bug (fixed)

Crash in find_program when PATH isn't defined

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

Description

In django/core/management/utils.py, the line that determines entries in the PATH looks like this:

path = os.environ.get('PATH', []).split(os.pathsep)

The problem is when PATH isn't defined, it calls [].split(), which leads to this exception:

AttributeError: 'list' object has no attribute 'split'

There is a pull request for this issue at https://github.com/django/django/pull/2422

Change History (8)

comment:1 by Baptiste Mispelon, 11 years ago

Component: UncategorizedCore (Management commands)
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Left a comment on the pull request regarding the test.

Once that's fixed, I think this is ready for checkin.

Thanks.

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

Resolution: fixed
Status: newclosed

In acee46fc950153c1c411f779b20f66141eb0d245:

Fixed #22256 -- Replaced bad fallback for missing PATH

Thanks Baptiste Mispelon for the review.

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

In 908bdea482d0a5af7a4c9d38ae52ed876d30cbe4:

[1.7.x] Fixed #22256 -- Replaced bad fallback for missing PATH

Thanks Baptiste Mispelon for the review.
Backport of acee46fc9 from master.

comment:4 by stodge@…, 11 years ago

When will this get fixed in stable/1.6.x and when will a new version of 1.6.x be released with it? Thanks

comment:5 by Claude Paroz, 11 years ago

OK, this is a crasher and a regression, it's worth backporting.

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

In 73474df9541bd5fabbf419debc5d72c09619f625:

Fixed #22256 -- Replaced bad fallback for missing PATH

Thanks Baptiste Mispelon for the review.
Backport of acee46fc9 from master.

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

In cfb7eca2a19119c4e54c3301918de360f8966984:

[1.7.x] Added 1.6.3 release note for refs #22256.

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

In 9769337ca855f4831c855d6663ff3f688ee1652d:

Added 1.6.3 release note for refs #22256.

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