]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42255: Deprecate webbrowser.MacOSX from Python 3.11 (GH-27837)
authorDong-hee Na <donghee.na@python.org>
Fri, 3 Sep 2021 16:21:03 +0000 (16:21 +0000)
committerGitHub <noreply@github.com>
Fri, 3 Sep 2021 16:21:03 +0000 (18:21 +0200)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Doc/library/webbrowser.rst
Doc/whatsnew/3.11.rst
Lib/webbrowser.py
Misc/NEWS.d/next/Library/2021-08-19-23-49-10.bpo-42255.ofe3ms.rst [new file with mode: 0644]

index bd0919164d8fa0ef64346eae00e2c5b6f98d3f42..27e0b51ccf89650e16e683530d4b31ac840d70f4 100644 (file)
@@ -143,9 +143,9 @@ for the controller classes, all defined in this module.
 +------------------------+-----------------------------------------+-------+
 | ``'windows-default'``  | :class:`WindowsDefault`                 | \(2)  |
 +------------------------+-----------------------------------------+-------+
-| ``'macosx'``           | :class:`MacOSX('default')`              | \(3)  |
+| ``'macosx'``           | :class:`MacOSXOSAScript('default')`     | \(3)  |
 +------------------------+-----------------------------------------+-------+
-| ``'safari'``           | :class:`MacOSX('safari')`               | \(3)  |
+| ``'safari'``           | :class:`MacOSXOSAScript('safari')`      | \(3)  |
 +------------------------+-----------------------------------------+-------+
 | ``'google-chrome'``    | :class:`Chrome('google-chrome')`        |       |
 +------------------------+-----------------------------------------+-------+
@@ -174,6 +174,9 @@ Notes:
 .. versionadded:: 3.3
    Support for Chrome/Chromium has been added.
 
+.. deprecated-removed:: 3.11 3.13
+   :class:`MacOSX` is deprecated, use :class:`MacOSXOSAScript` instead.
+
 Here are some simple examples::
 
    url = 'https://docs.python.org/'
index d6a95a2e3175c7a318d1745b034db353e4cf754c..896a292c3356e82aeb9970d8600722c855cbb761 100644 (file)
@@ -292,6 +292,10 @@ Deprecated
   Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython).
   (Contributed by Victor Stinner in :issue:`40360`.)
 
+* :class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
+  It is untested and undocumented and also not used by webbrowser itself.
+  (Contributed by Dong-hee Na in :issue:`42255`.)
+
 
 Removed
 =======
index ec3cece48c9587b73913b1838f49dab2f04afd1c..d8a9915cac5f6f40ca009a9356b3ce87334e9fac 100755 (executable)
@@ -8,6 +8,7 @@ import shutil
 import sys
 import subprocess
 import threading
+import warnings
 
 __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
 
@@ -629,6 +630,8 @@ if sys.platform == 'darwin':
         Internet System Preferences panel, will be used.
         """
         def __init__(self, name):
+            warnings.warn(f'{self.__class__.__name__} is deprecated in 3.11'
+                          ' use MacOSXOSAScript instead.', DeprecationWarning, stacklevel=2)
             self.name = name
 
         def open(self, url, new=0, autoraise=True):
diff --git a/Misc/NEWS.d/next/Library/2021-08-19-23-49-10.bpo-42255.ofe3ms.rst b/Misc/NEWS.d/next/Library/2021-08-19-23-49-10.bpo-42255.ofe3ms.rst
new file mode 100644 (file)
index 0000000..84a02c4
--- /dev/null
@@ -0,0 +1,3 @@
+:class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
+It is untested and undocumented and also not used by webbrowser itself.
+Patch by Dong-hee Na.