Opened 11 years ago

Closed 11 years ago

#22358 closed Uncategorized (needsinfo)

`ImportError` swallowing masks bugs

Reported by: Ram Rachum 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

Description

(Using Django 1.6.2.)

When there's an ImportError in my user.py 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 manage.py migrate doesn't work, but python manage.py 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 by Tim Graham, 11 years ago

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 by Ram Rachum, 11 years ago

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 user.py and then just put import non_existing_module at the top of that file.

comment:3 by Tim Graham, 11 years ago

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