Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #468 (closed defect: fixed)

Opened 12 years ago

Last modified 10 years ago

[PATCH] Kid configuration settings ignored

Reported by: Dan Jacob Owned by: anonymous
Priority: normal Milestone: 1.0b3
Component: TurboGears Version:
Severity: major Keywords:
Cc:

Description

Kid template settings in config.py or devcfg.py such as i18n.runTemplateFilter are ignored when initializing the template engines in turbogears/view.py

The start-<myproject>.py script imports turbogears before the cherrypy.config settings are read from the file(s) or command line. As a result, view.py is already imported and the engines already initialized before the correct configuration options are available.

Suggested fix

Place the engine setup code into a function, e.g. _load_engines(), and call this function inside _choose_engine() in view.py. This function checks if the engines dict is empty and carries out initialization if not. This should ensure that the configuration options are already in cherrypy.config first.

Attachments

view.patch Download (2.4 KB) - added by Dan Jacob 12 years ago.
Patch to resolve configuration issue
base.patch Download (562 bytes) - added by ksenia.marasanova@… 11 years ago.
encoding.patch Download (2.8 KB) - added by Joost 11 years ago.
test.patch Download (977 bytes) - added by Joost 11 years ago.
regression test

Change History

comment:1 Changed 12 years ago by Dan Jacob

  • Status changed from new to assigned
  • Component changed from CherryPy to TurboGears

Patch as suggested above.

Changed 12 years ago by Dan Jacob

Patch to resolve configuration issue

comment:2 Changed 12 years ago by anonymous

  • Summary changed from Kid configuration settings ignored to [PATCH] Kid configuration settings ignored

comment:3 Changed 12 years ago by kevin

  • Status changed from assigned to closed
  • Resolution set to fixed

This was committed in [582].

comment:4 Changed 11 years ago by ksenia.marasanova@…

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Milestone changed from 0.9 to 1.0b2

Since changeset 1728 this problem reappears. Attached the simple patch against 1.0 branch that basically discards that changeset.

Changed 11 years ago by ksenia.marasanova@…

comment:5 Changed 11 years ago by mbevan

  • Milestone changed from 1.0b2 to 1.0b3

This has sat for two months and through one release. This changeset is critical for the applications I develop.

Please get this patch applied to the 1.0 branch.

comment:6 Changed 11 years ago by matt

The patch breaks the unit tests, so it cannot be applied as is. See [1728].

Changed 11 years ago by Joost

Changed 11 years ago by Joost

regression test

comment:7 Changed 11 years ago by alberto

  • Status changed from reopened to closed
  • Resolution set to fixed

Comitted last two patches which should hopefully close this. Re-open (as usual) if it doesn't.

Alberto

comment:8 Changed 11 years ago by alberto

comitted at [2259]

comment:9 Changed 10 years ago by chrisz

This fix solves only the kid.encoding issue, the general issue - that load_engines() is called in view.py before the config is set up - still remains (as of version 1.0.4b2). I suggest solving it in #1277.

Note: See TracTickets for help on using tickets.