Opened 17 months ago

Closed 17 months ago

Last modified 16 months ago

#22256 closed Bug (fixed)

Crash in find_program when PATH isn't defined

Reported by: vegitron Owned by: nobody
Component: Core (Management commands) Version: master
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 Changed 17 months ago by bmispelon

  • Component changed from Uncategorized to Core (Management commands)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Left a comment on the pull request regarding the test.

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

Thanks.

comment:2 Changed 17 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In acee46fc950153c1c411f779b20f66141eb0d245:

Fixed #22256 -- Replaced bad fallback for missing PATH

Thanks Baptiste Mispelon for the review.

comment:3 Changed 17 months ago by Claude Paroz <claude@…>

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 Changed 16 months ago by stodge@…

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 Changed 16 months ago by claudep

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

comment:6 Changed 16 months ago by Claude Paroz <claude@…>

In 73474df9541bd5fabbf419debc5d72c09619f625:

Fixed #22256 -- Replaced bad fallback for missing PATH

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

comment:7 Changed 16 months ago by Claude Paroz <claude@…>

In cfb7eca2a19119c4e54c3301918de360f8966984:

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

comment:8 Changed 16 months ago by Claude Paroz <claude@…>

In 9769337ca855f4831c855d6663ff3f688ee1652d:

Added 1.6.3 release note for refs #22256.

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