From: Brett Cannon Date: Sat, 30 Apr 2022 01:22:10 +0000 (-0700) Subject: gh-91217: deprecate xdrlib (GH-92066) X-Git-Tag: v3.11.0b1~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2b579741dc36f4b7da00d4361d651544996d8f4;p=thirdparty%2FPython%2Fcpython.git gh-91217: deprecate xdrlib (GH-92066) Automerge-Triggered-By: GH:brettcannon --- diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 5f1f995a0fe2..3ba35a8620a5 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1081,6 +1081,7 @@ Deprecated * :mod:`sunau` * :mod:`telnetlib` * :mod:`uu` + * :mod:`xdrlib` (Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:`68966`.) diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py index 3df5f264ced4..226b70ae87b0 100644 --- a/Lib/test/test_xdrlib.py +++ b/Lib/test/test_xdrlib.py @@ -1,6 +1,8 @@ import unittest +from test.support import warnings_helper + +xdrlib = warnings_helper.import_deprecated("xdrlib") -import xdrlib class XDRTest(unittest.TestCase): diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py index d6e1aeb52726..b56ffa59b73d 100644 --- a/Lib/xdrlib.py +++ b/Lib/xdrlib.py @@ -7,6 +7,9 @@ See: RFC 1014 import struct from io import BytesIO from functools import wraps +import warnings + +warnings._deprecated(__name__, remove=(3, 13)) __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] diff --git a/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst b/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst new file mode 100644 index 000000000000..14f2c4d06491 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst @@ -0,0 +1 @@ +Deprecate the xdrlib module.