Ticket #361 (closed defect: duplicate)

Opened 6 years ago

Last modified 6 years ago

Failure to handle default value containing '%' character

Reported by: michael.goffioul@… Owned by: andrew
Priority: minor Milestone:
Component: migrations Version: 0.6.1
Keywords: Cc:


South fails to handle text fields with default value containing '%' character. Let's say I have a model:

class A(models.Model):
    f = models.CharField(max_length=100, default='My %(string)s')

The initial migration script generated by south will fail to run, because somewhere in the process, a string formatting will take place, trying to replace '%(string)s', and fail. I have to hand-edit the migration script and replace '%' with '%%'. "./manage.py syncdb" on a cleaned DB works fine, though.

If I make further changes to the model and create a new migration script, south will think the default value of field 'f' has changed (because of the previous hand-editing) and include it into the new migration script.

Change History

comment:1 Changed 6 years ago by andrew

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

You've reported this against 0.6.1, which is neither the most recent stable version nor the most recent development version.

This error is fixed in trunk (and is a duplicate of #352), so closing.

Note: See TracTickets for help on using tickets.