From da7f8320173589ec4d9a4c40574934654514cb79 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 17 Apr 2022 12:08:08 -0700 Subject: [PATCH 1/2] deprecate the `pipes` module --- Lib/pipes.py | 3 +++ Lib/test/test_pipes.py | 4 +++- .../Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst diff --git a/Lib/pipes.py b/Lib/pipes.py index 8cc74b0f1f781b..61d63b48d3e4c5 100644 --- a/Lib/pipes.py +++ b/Lib/pipes.py @@ -60,10 +60,13 @@ import re import os import tempfile +import warnings # we import the quote function rather than the module for backward compat # (quote used to be an undocumented but used function in pipes) from shlex import quote +warnings._deprecated(__name__, remove=(3, 13)) + __all__ = ["Template"] # Conversion step kinds diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py index 6335e7cbe09c4e..09e21153ec858a 100644 --- a/Lib/test/test_pipes.py +++ b/Lib/test/test_pipes.py @@ -1,10 +1,12 @@ -import pipes import os import string import unittest import shutil from test.support import reap_children, unix_shell from test.support.os_helper import TESTFN, unlink +from test.support.warnings_helper import import_deprecated + +pipes = import_deprecated("pipes") if os.name != 'posix': diff --git a/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst b/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst new file mode 100644 index 00000000000000..fc8ed5775bbb24 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst @@ -0,0 +1 @@ +Deprecate the 'pipes' module. From 742de32427b75d862a535b2000c1e8e06257b9c7 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 20 Apr 2022 20:48:19 -0700 Subject: [PATCH 2/2] deprecate `pipes` --- Doc/whatsnew/3.11.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index bedf80a72fab5c..37d2b100a0e602 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -884,6 +884,7 @@ Deprecated * :mod:`msilib` * :mod:`nis` * :mod:`nntplib` + * :mod:`pipes` (Contributed by Brett Cannon in :issue:`47061`.)