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 #2533 (closed defect: migrated)

Opened 9 years ago

Last modified 8 years ago

Warnings are reset when in debug mode

Reported by: silentsound Owned by:
Priority: normal Milestone: __unclassified__
Component: TurboGears Version: 2.1rc1
Severity: normal Keywords:
Cc:

Description

When in debug mode, configuration.py does the following on line 201:

if asbool(config['debug']):
    warnings.simplefilter("ignore")
    config['pylons.strict_c'] = True
    warnings.resetwarnings()
    config['pylons.stritmpl_contextt_tmpl_context'] = True

This causes all previously configured warning filters to be lost. A better way to temporarily catch all warnings is the following:

if asbool(config['debug']):
    filters = warnings.filters[:]
    warnings.simplefilter("ignore")
    config['pylons.strict_c'] = True
    warnings.filters = filters
    config['pylons.stritmpl_contextt_tmpl_context'] = True

This approach is used by foreach.py in FormEncode, for example.

Change History

comment:1 Changed 8 years ago by pedersen

  • Status changed from new to closed
  • Resolution set to migrated
Note: See TracTickets for help on using tickets.