migration names with special characters

8 views
Skip to first unread message

Stefan Foulis

unread,
Oct 29, 2009, 6:02:10 AM10/29/09
to South Users
Hi
I just stumbled upon some migrations named things like "unique = true
on slugs etc" (with the filename "0002_unique = true on slugs
etc.py"). I was quite amazed when this migration actually worked,
since that is not a valid python module name.
This could result in problems depending on the filesystem... so I did
a check. On my mac I created a migration called "0002_:evil?.py". That
works fine. But Windows with NTFS does not allow the ":" or the "?"
character in filenames.

Maybe it would be a good idea to use a "slugified" version of the name
for the filename that is a valid python module name instead. A
"prettier" version could be stored as a unicode string on the
migration class. Or just only allow alphanumerics and the _ in
migration names.

I did not find a ticket about this. Should I create one?

Thanks,
Stefan

Andrew Godwin

unread,
Oct 29, 2009, 6:14:40 AM10/29/09
to south...@googlegroups.com
It might just be a better idea to limit what people can type in - I see
no need to store a prettier version that's only slightly longer, instead
of adding a docstring to the module. If you could make a ticket about
"restrict migration names to be valid module names" that'd be great.

It is amazing that it can load the "002_unique = true on slugs etc" name
- must be a peculiarity of the way I do imports.

Andrew

Stefan Foulis

unread,
Oct 29, 2009, 8:11:21 AM10/29/09
to South Users
I added the ticket: http://south.aeracode.org/ticket/275
Reply all
Reply to author
Forward
0 new messages