From 032d8352ed37a1af0b4f5c1640254f40751c7b9f Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 9 Jun 2023 08:39:36 +0300 Subject: [PATCH 1/6] gh-105545: Remove deprecated `MacOSXOSAScript._name` --- Lib/webbrowser.py | 14 -------------- .../2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index c1bd667a56e579..01a82fb8857cfa 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -578,20 +578,6 @@ class MacOSXOSAScript(BaseBrowser): def __init__(self, name='default'): super().__init__(name) - @property - def _name(self): - warnings.warn(f'{self.__class__.__name__}._name is deprecated in 3.11' - f' use {self.__class__.__name__}.name instead.', - DeprecationWarning, stacklevel=2) - return self.name - - @_name.setter - def _name(self, val): - warnings.warn(f'{self.__class__.__name__}._name is deprecated in 3.11' - f' use {self.__class__.__name__}.name instead.', - DeprecationWarning, stacklevel=2) - self.name = val - def open(self, url, new=0, autoraise=True): if self.name == 'default': script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser diff --git a/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst b/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst new file mode 100644 index 00000000000000..f27692126a7ec4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst @@ -0,0 +1 @@ +Remove deprecated in 3.11 ``webbrowser.MacOSXOSAScript._name`` attribute. From 75c6b10b72b9d99fac3e4a4a397d4fa14bc27238 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 9 Jun 2023 08:42:53 +0300 Subject: [PATCH 2/6] Adds Whats New entry --- Doc/whatsnew/3.13.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 502cafdaf5e19f..12e8b7e322d1bc 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -324,6 +324,9 @@ Removed certificates for you. (Contributed by Victor Stinner in :gh:`105382`.) +* Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. + (Contributed by Nikita Sobolev in :gh:`105546`.) + Porting to Python 3.13 ====================== From d27f640042b9afdca7ac1a6fd7267b67b2877c62 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 9 Jun 2023 08:48:44 +0300 Subject: [PATCH 3/6] Adds Whats New entry --- Doc/whatsnew/3.13.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 12e8b7e322d1bc..b8239da57c7f15 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -325,6 +325,7 @@ Removed (Contributed by Victor Stinner in :gh:`105382`.) * Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. + Use ``.name`` attribute instead. (Contributed by Nikita Sobolev in :gh:`105546`.) From 0aff6112dadb19a3edda3914fb44b5b4f030a179 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 9 Jun 2023 09:50:50 +0300 Subject: [PATCH 4/6] Update Doc/whatsnew/3.13.rst Co-authored-by: Dong-hee Na --- Doc/whatsnew/3.13.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index b8239da57c7f15..4efcb85540c50b 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -325,7 +325,7 @@ Removed (Contributed by Victor Stinner in :gh:`105382`.) * Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. - Use ``.name`` attribute instead. + Use :attr:`webbrowser.MacOSXOSAScript.name` attribute instead. (Contributed by Nikita Sobolev in :gh:`105546`.) From e402ffe52ae90aa0d741a0dd5afc94f8fe5d2fb8 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 9 Jun 2023 10:17:18 +0300 Subject: [PATCH 5/6] Proper link --- Doc/library/webbrowser.rst | 2 +- Doc/whatsnew/3.13.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index 2f0b5feb8cbc75..b6762f78830a5f 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -196,7 +196,7 @@ Browser controllers provide these methods which parallel three of the module-level convenience functions: -.. attribute:: name +.. attribute:: controller.name System-dependent name for the browser. diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 4efcb85540c50b..0b9e182af935a9 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -325,7 +325,7 @@ Removed (Contributed by Victor Stinner in :gh:`105382`.) * Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. - Use :attr:`webbrowser.MacOSXOSAScript.name` attribute instead. + Use :attr:`webbrowser.MacOSXOSAScript.name ` attribute instead. (Contributed by Nikita Sobolev in :gh:`105546`.) From 5a2303860e1c2743c9908a56bfe92638ef7de2ca Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 9 Jun 2023 11:20:05 +0300 Subject: [PATCH 6/6] Fix CI --- Doc/whatsnew/3.13.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 0b9e182af935a9..fbd2fdb80bf041 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -325,7 +325,8 @@ Removed (Contributed by Victor Stinner in :gh:`105382`.) * Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. - Use :attr:`webbrowser.MacOSXOSAScript.name ` attribute instead. + Use :attr:`webbrowser.MacOSXOSAScript.name ` + attribute instead. (Contributed by Nikita Sobolev in :gh:`105546`.)