Opened 4 years ago

Closed 4 years ago

#18075 closed Bug (invalid)

LOCALE_PATHS needs "," at the end of the locations

Reported by: esevece Owned by: nobody
Component: Translations Version: master
Severity: Normal Keywords:
Cc: esevece 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 4 years ago by esevece

  • Cc esevece added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by claudep

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

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 4 years ago by esevece

Ok. Sorry.
Thank you!

comment:4 Changed 4 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to 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 Changed 4 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 4 years ago by ramiro

  • Resolution set to invalid
  • Status changed from reopened to 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:

I'm closing this ticket for the reasons given above

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