From 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Mon, 10 May 2021 14:18:43 +0200 Subject: [PATCH] Deprecate the fnmatch module. Oslo.utils's fnmatch module was added to fix the py2.7 fnmatch module who was not thread safe [1]. Python 2.7 is no longer supported so now we can use the stdlib's fnmatch module and deprecate the one of oslo.utils. [1] https://bugs.python.org/issue23191$ [2] https://opendev.org/openstack/oslo.utils/commit/e46a46ba90741987f1147afc56876e3d0d27e8a2 Change-Id: I538379f91d2ba415c566ada8d221b62b47ba80bb --- oslo_utils/fnmatch.py | 9 +++++++++ .../notes/deprecate-fnmatch-057a092d434a0c53.yaml | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/deprecate-fnmatch-057a092d434a0c53.yaml diff --git a/oslo_utils/fnmatch.py b/oslo_utils/fnmatch.py index 71439ab9..c52cf055 100644 --- a/oslo_utils/fnmatch.py +++ b/oslo_utils/fnmatch.py @@ -24,6 +24,15 @@ import os import posixpath import re import sys +import warnings + +import debtcollector + +warnings.simplefilter("always") +debtcollector.deprecate( + "Using the oslo.utils's 'fnmatch' module is deprecate, " + "please use the stdlib `fnmatch` module." +) if sys.version_info > (2, 7, 9): diff --git a/releasenotes/notes/deprecate-fnmatch-057a092d434a0c53.yaml b/releasenotes/notes/deprecate-fnmatch-057a092d434a0c53.yaml new file mode 100644 index 00000000..e187d5f3 --- /dev/null +++ b/releasenotes/notes/deprecate-fnmatch-057a092d434a0c53.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + Oslo.utils's ``fnmatch`` module is deprecated, please use the stdlib + ``fnmatch`` module which is thread safe for python 3+.