I'm playing around with 1.7b4 and I was trying to track down why my app was 
not auto-reloading when files were changed using the dev server.

Turns out, it was an improperly configured LOCALE_PATHS setting.

My LOCALE_PATHS was configured like this:

LOCALE_PATHS = (
    '/path/to/locale'
)

At first glance, it looks okay. But it's actually a string and not a tuple 
since it does not have a comma.

This causes a problem in the autoloader, here:

https://github.com/django/django/blob/608e6eb2959c6e56e5c702ca0d15fa0e6c2eef16/django/utils/autoreload.py#L98

This would be fine, but since LOCALE_PATHS is a string, calling 
basedirs.extend(LOCALE_PATHS) actually causes every character in the string 
to get appended to basedirs. Then it walks through the tree and tries to 
find .mo files. And since there are 3 slashes in the string, the autoloader 
attempts to search the root drive 3 times.

Bottom line is that having LOCALE_PATHS set to a string with slashes causes 
autoreloading to essentially take *forever*. 

Maybe adding a warning/validation to ensure LOCALE_PATHS is a list/tuple 
would be a good idea?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c6c18d71-5da5-4aaf-83e9-db3b2d86e430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to