Opened 4 years ago

Closed 4 years ago

#22358 closed Uncategorized (needsinfo)

`ImportError` swallowing masks bugs

Reported by: coolRR Owned by: nobody
Component: Uncategorized Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


(Using Django 1.6.2.)

When there's an ImportError in my file, (like when forgetting to install a third-party module,) Django seems to swallow it, and instead of raising an exception with a meaningful stacktrace, it just makes some things not work. (e.g. trying python migrate doesn't work, but python shell does.)

This makes it hard to debug and confusing, especially for my non-Django-expert coworkers. Please show a meaningful traceback if there's an ImportError.

Change History (3)

comment:1 Changed 4 years ago by Tim Graham

Please provide a sample project to reproduce the error. Ideally, one that's not dependent on third-party modules like south which I assume you are using given your example of migrate, so we can rule out a bug in a third-party module. It would also be helpful if you could test on 1.7 beta to confirm the issue hasn't since been fixed.

comment:2 Changed 4 years ago by coolRR

Sorry, no time. (I totally understand if you don't have time for this either, I had time just to report this bug but not follow the discussion and give a sample.)

I do believe it'll happen if you define a Django app with a User module in and then just put import non_existing_module at the top of that file.

comment:3 Changed 4 years ago by Tim Graham

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top