[FIX] core: avoid deprecation warning in requests_toolbelt

The requests_toolbelt package < 0.9 uses `from collections import ...`
which is deprecated in python 3.8 [0].

The request_toolbelt package is not a dependency of Odoo but is needed
by zeep [1]. Unfortunately, the Ubuntu python3-requests-toolbelt package
is still 0.8 [2].

This commit filters out the warning.

[0] https://github.com/requests/toolbelt/commit/979f95266c2044893b05cb2314e94c899915748c
[1] https://packages.ubuntu.com/focal/python3-zeep
[2] https://packages.ubuntu.com/focal/python3-requests-toolbelt

closes odoo/odoo#71056

X-original-commit: 91dd6171dac567e5f0185e53982ede3b166cfe7c
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Christophe Monniez
2021-05-19 16:11:29 +00:00
parent a50157e60e
commit 25567ff92b
+1
View File
@@ -138,6 +138,7 @@ def init_logger():
'reportlab.lib.rl_safe_eval',# reportlab importing ABC from collections
'ofxparse',# ofxparse importing ABC from collections
'astroid', # deprecated imp module (fixed in 2.5.1)
'requests_toolbelt', # importing ABC from collections (fixed in 0.9)
]:
warnings.filterwarnings('ignore', category=DeprecationWarning, module=module)