[Python-checkins] gh-91217: deprecate-pipes (GH-91779)

brettcannon webhook-mailer at python.org
Thu Apr 21 22:28:43 EDT 2022


https://github.com/python/cpython/commit/2551a6c92f247eed8121b14f151acd95432dff9e
commit: 2551a6c92f247eed8121b14f151acd95432dff9e
branch: main
author: Brett Cannon <brett at python.org>
committer: brettcannon <brett at python.org>
date: 2022-04-21T19:28:34-07:00
summary:

gh-91217: deprecate-pipes (GH-91779)

files:
A Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst
M Doc/whatsnew/3.11.rst
M Lib/pipes.py
M Lib/test/test_pipes.py

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index c3a8a7e42a110..75ea70b7a1832 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -919,6 +919,7 @@ Deprecated
   * :mod:`nis`
   * :mod:`nntplib`
   * :mod:`ossaudiodev`
+  * :mod:`pipes`
 
   (Contributed by Brett Cannon in :issue:`47061`.)
 
diff --git a/Lib/pipes.py b/Lib/pipes.py
index 8cc74b0f1f781..61d63b48d3e4c 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 6335e7cbe09c4..09e21153ec858 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 0000000000000..fc8ed5775bbb2
--- /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.



More information about the Python-checkins mailing list