Ticket #31 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

Confusing error in startmigration --initial if the directory already exists

Reported by: jacob@… Owned by: andrew
Priority: major Milestone:
Component: commands Version:
Keywords: Cc:


If you issue startmigration --initial on an app that already has a migrations directory but doesn't have an, you get a confusing error:

(endorsements)jacob@dorkbook:~/Projects/endorsements$ ./bin/django startmigration endorsements --initial
Traceback (most recent call last):
  File "./bin/django", line 25, in <module>
  File "/Users/jacob/Projects/endorsements/eggs/djangorecipe-0.12.1-py2.5.egg/djangorecipe/", line 15, in main
  File "/Users/jacob/Projects/endorsements/parts/django/django/core/management/", line 340, in execute_manager
  File "/Users/jacob/Projects/endorsements/parts/django/django/core/management/", line 295, in execute
  File "/Users/jacob/Projects/endorsements/parts/django/django/core/management/", line 77, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/jacob/Projects/endorsements/parts/django/django/core/management/", line 96, in execute
    output = self.handle(*args, **options)
  File "/Users/jacob/Projects/endorsements/parts/svn-dependancies/south/management/commands/", line 89, in handle
    migrations = migration.get_migration_names(migration.get_app(app))
  File "/Users/jacob/Projects/endorsements/parts/svn-dependancies/south/", line 60, in get_migration_names
    for filename in os.listdir(os.path.dirname(app.__file__))
AttributeError: 'NoneType' object has no attribute '__file__'

[In this case I already had a "migrations" directory from a previous migration tool; it contains a bunch of SQL files, but no]

South should detect this situation and either create the needed empty or give a more clear error.


Change History

comment:1 Changed 5 years ago by andrew

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

Fixed in [95], by creating the

comment:2 Changed 5 years ago by andrew

I meant, of course. Formatting fail.

comment:3 Changed 5 years ago by alarroste

Hello webmaster,
I would like to share with you a link, write to alarroste@…


Add a comment

Modify Ticket

as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.