Opened 13 years ago
Closed 13 years ago
#18075 closed Bug (invalid)
LOCALE_PATHS needs "," at the end of the locations
Reported by: | Stefano Vettorazzi Campos | Owned by: | nobody |
---|---|---|---|
Component: | Translations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Stefano Vettorazzi Campos | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have wrote it in settings.py:
LOCALE_PATHS = ( "/home/ubuntu/.../locale" )
But translation didn't work.
Then I have wrote:
LOCALE_PATHS = ( "/home/ubuntu/.../locale/", )
And it works.
It took me one day for me to realize! HaHaHa
Change History (6)
comment:1 by , 13 years ago
Cc: | added |
---|
comment:2 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:4 by , 13 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Django could easily check if passed element is atleast iterable to avoid such troubles (it also took an hour of debugging from me since django does not provide any information with locale paths is it using ATM).
comment:5 by , 13 years ago
As much as this is a fundamental Python syntax issue, the django devs have set a precedent in protecting users from this issue.
In the Settings class, there is the following:
# Settings that should be converted into tuples if they're mistakenly entered # as strings. tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")
comment:6 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
I don't think we should be adapting the Django code to hand-holding users with basic Python concepts like these for every setting. IIRC I've read one core developer (In a ticket comment? in a mailing list post? in IRC?) regretting introduction of the feature FunkyBob points to (#88/r213): Automatic fixing of invalid setting values. See also: https://code.djangoproject.com/ticket/15094#comment:3
I'm closing this ticket for the reasons given above
The documentation tells clearly that it's a tuple.
https://docs.djangoproject.com/en/1.4/ref/settings/#locale-paths
Now it's about knowledge of Python syntax, a tuple containing only one element must end with a comma.