diff options
| author | Xavier Morel <xmo@odoo.com> | 2020-04-16 11:38:32 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2020-04-22 09:27:29 +0000 |
| commit | 3f2a18b0f2d7a1f8da9ce8038278a2cc7b108c55 (patch) | |
| tree | b4d8ffa92dc17a33099c60193b37e51761af84a9 /odoo/netsvc.py | |
| parent | 92b007cb8956fbfd1eecd955d4946b37756fd726 (diff) | |
[FIX] core: improve warnings configuration
DeprecationWarning was configured as `once` which might be why I
missed some previously: `once` means the *filter* will only signal
once, meaning only one DeprecationWarning gets shown per run. Even if
there are 5 *completely different* warnings getting generated by the
codebase.
`default` should be more suitable, I think I'd originally
misunderstood it as "whatever the default is for this warning" but
what it *actually* means is "print once for each (module, lineno)".
An alternative could be `module` which would show the warning once per
module but wouldn't trigger from different warnings in the same module.
Diffstat (limited to 'odoo/netsvc.py')
| -rw-r--r-- | odoo/netsvc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/netsvc.py b/odoo/netsvc.py index 9025532f32f..3e387352d0d 100644 --- a/odoo/netsvc.py +++ b/odoo/netsvc.py @@ -126,7 +126,7 @@ def init_logger(): logging.setLogRecordFactory(record_factory) # enable deprecation warnings (disabled by default) - warnings.filterwarnings('once', category=DeprecationWarning) + warnings.filterwarnings('default', category=DeprecationWarning) # ignore deprecation warnings from invalid escape (there's a ton and it's # pretty likely a super low-value signal) warnings.filterwarnings('ignore', r'^invalid escape sequence \\.', category=DeprecationWarning) |
