Opened 7 years ago

Closed 7 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: master
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


I have wrote it in


But translation didn't work.

Then I have wrote:


And it works.

It took me one day for me to realize! HaHaHa

Change History (6)

comment:1 Changed 7 years ago by Stefano Vettorazzi Campos

Cc: Stefano Vettorazzi Campos added

comment:2 Changed 7 years ago by Claude Paroz

Resolution: invalid
Status: newclosed

The documentation tells clearly that it's a tuple.

Now it's about knowledge of Python syntax, a tuple containing only one element must end with a comma.

comment:3 Changed 7 years ago by Stefano Vettorazzi Campos

Ok. Sorry.
Thank you!

comment:4 Changed 7 years ago by anonymous

Resolution: invalid
Status: closedreopened

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 Changed 7 years ago by FunkyBob

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 Changed 7 years ago by Ramiro Morales

Resolution: invalid
Status: reopenedclosed

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:

I'm closing this ticket for the reasons given above

Last edited 7 years ago by Ramiro Morales (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top