Ticket #347 (new defect)

Opened 3 years ago

use = config has unexpected behavior if inherited config uses filter-with

Reported by: davidi Owned by: ianb
Priority: normal Milestone: 1.4.1
Component: deploy Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

If use=config:something.ini#name is used, and someting.ini's [name] block has a filter-with clause, the inherited configuration settings for [name] will be used instead of the ones in the inheriting configuration file.

This appears to be because when filter-with is used in the inherited configuration file, ConfigLoader?.get_context returns a multi-level context object, with a top level FILTER_WITH context containing a FILTER context and an APP context.

When control passes back to ConfigLoader?._context_from_use, configuration options from the inheriting file are added to the FILTER_WITH context. Finally, when the multi-level context is envoked in _FilterWith, the two child contexts are invoked and the FILTER_WITH context's configuration settings are completely ignored.

My solution was to have ConfigLoader?._context_from_use check to see if a returned context was a FILTER_WITH context, and if so apply the configuration options to its child APP context (its .next_context attribute) instead.

Attachments

loadwsgi_patch2 Download (0.9 KB) - added by davidi 3 years ago.
patch for /paste/deploy/loadwsgi.py

Change History

Changed 3 years ago by davidi

patch for /paste/deploy/loadwsgi.py

Note: See TracTickets for help on using tickets.