Code

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#10696 closed Bug (duplicate)

manage.py throws away exception information

Reported by: Leo Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

When an ImportError occurs in manage.py, the exception is caught and stored in a variable - e, but that data isn't used in the error message at all.

Because settings.py is a python file, there could be a variety of issues that come up and its useful to see what the actual underlying error is. In my usecase, I have the line

from settings_local import *

at the end of the main settings.py file. If settings_local.py doesn't exist, then an import error gets thrown but the exception handling in manage.py swallows it. It would be great to add something like:

sys.stderr.write(e.message + '\n')

to manage.py to surface the actual error that's occurring.

Attachments (0)

Change History (7)

comment:1 Changed 5 years ago by thatch

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 5 years ago by jacob

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 5 years ago by jacob

  • milestone 1.1 deleted

comment:4 Changed 5 years ago by jacob

  • Triage Stage changed from Accepted to Design decision needed

comment:5 Changed 3 years ago by sethtrain

  • Severity set to Normal
  • Type set to Bug

comment:6 Changed 3 years ago by graham_king

  • Easy pickings unset
  • Resolution set to duplicate
  • Status changed from new to closed

Looks like a duplicate of #14130. Please re-open if I'm mistaken.

Either way, the problem is gone. I've tried every which way I can think to cause an error in settings.py (import errors, regular errors, file permission errors deep within the logging module, etc) and it always gets reported correctly to the console.

comment:7 Changed 3 years ago by Leo

Thanks Graham. It is a dup and it's all fixed.

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.