FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-42255: Deprecate webbrowser.MacOSX from Python 3.11 by corona10 · Pull Request #27837 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (3) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 5 additions & 2 deletions Doc/library/webbrowser.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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) |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This section should be backported

+------------------------+-----------------------------------------+-------+
| ``'safari'`` | :class:`MacOSX('safari')` | \(3) |
| ``'safari'`` | :class:`MacOSXOSAScript('safari')` | \(3) |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This section should be backported

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't think we can reasonably call renaming MacOSX to MacOSXOSAScript a "backport" of this PR since it is about the deprecation. I'll of course accept PRs to 3.10 and 3.9 that make this doc change.

+------------------------+-----------------------------------------+-------+
| ``'google-chrome'`` | :class:`Chrome('google-chrome')` | |
+------------------------+-----------------------------------------+-------+
Expand Down Expand Up @@ -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/'
Expand Down
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.11.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======
Expand Down
3 changes: 3 additions & 0 deletions Lib/webbrowser.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import subprocess
import threading
import warnings

__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]

Expand Down Expand Up @@ -629,6 +630,8 @@ class MacOSX(BaseBrowser):
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):
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -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.

Back | FazBrowse Home | New Git URL