Ticket #29 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

show import errors rather than saying "doesn't exist"

Reported by: anonymous Owned by: andrew
Priority: major Milestone:
Component: commands Version: 0.6-pre
Keywords: Cc:


I had a typo in one of my models (model vs models) so south couldn't import it -- but rather than saying so, it kept insisting it didn't exist.

Change History

comment:1 Changed 7 years ago by andrew

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

This is a difficult one - the only way we can detect if a migration doesn't exist is to try to import it and see if ImportError? is raised, and it's nigh-on impossible (bar some ugly string parsing) to tell the "migration not here" error from the "problem inside the migration" error.

The same problem is in Django settings.py files - import something spurious inside there and see Django claim your conf doesn't exist.

Marking as WONTFIX for now, until a sensible solution can be found (and Django hasn't found one yet...). I will, however, stick an FAQ up about it.

comment:2 Changed 7 years ago by anonymous

Why not just display the import error?

I think the gain in seeing problems with the migration trumps the loss in clarity from the 'no module named blahbity.blah' vs a filename. At a minimum, the error would be clearer if it said 'unable to import'.

Just because Django does it wrong doesn't mean one has to follow suit! I mean that tongue in cheek, but seriously, it's a source of frustration in Django, too - it's not like one can ignore the error, but it does make tracking them down more difficult.

comment:3 Changed 7 years ago by andrew

  • Status changed from closed to reopened
  • Resolution wontfix deleted

You have a good point, and I'll try not to reply in a stupid way to tickets next time. I've checked in [78] - it prints a "we think it's missing" error message, and also shows the traceback.

comment:4 Changed 7 years ago by andrew

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

Fixed in [78], and Trac doesn't allow wontfix -> fixed

comment:5 Changed 7 years ago by anonymous


Note: See TracTickets for help on using tickets.