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

gh-149567: Remove deprecated `shutil.ExecError` by StanFromIreland · Pull Request #149568 · 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  (3) .rst  (2) 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
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.16.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 @@ -141,6 +141,13 @@ mimetypes
:meth:`mimetypes.MimeTypes.add_type`.
Undotted extensions now raise a :exc:`ValueError`.

shutil
------

* The :exc:`!ExecError` exception which has been deprecated since Python 3.14.
It has not been used by any function in :mod:`!shutil` since Python 3.4.
(Contributed by Stan Ulbrych in :gh:`149567`.)

symtable
--------

Expand All @@ -161,6 +168,7 @@ sysconfig
* The :func:`!sysconfig.expand_makefile_vars` function
which has been deprecated since Python 3.14.
Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
(Contributed by Stan Ulbrych in :gh:`149499`.)

tarfile
-------
Expand Down
12 changes: 0 additions & 12 deletions Lib/shutil.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 @@ -1638,15 +1638,3 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
if _access_check(name, mode):
return name
return None

def __getattr__(name):
if name == "ExecError":
import warnings
warnings._deprecated(
"shutil.ExecError",
f"{warnings._DEPRECATED_MSG}; it "
"isn't raised by any shutil function.",
remove=(3, 16)
)
return RuntimeError
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
4 changes: 2 additions & 2 deletions Lib/test/test_peepholer.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 @@ -1127,8 +1127,8 @@ def test_import_from_doesnt_clobber_load_fast_borrow(self):
def f(self):
if x: pass
self.x
from shutil import ExecError
print(ExecError)
from heapq import heapify_max

StanFromIreland May 8, 2026 •
edited
Loading

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

Turns out it was used somewhere after all! Technically this doesn't matter, but to avoid any potential confusion I changed it to something else.

I confirmed it still fails when 1561385 is reverted.

print(heapify_max)
self.assertInBytecode(f, "LOAD_FAST_BORROW", "self")

class DirectCfgOptimizerTests(CfgOptimizationTestCase):
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_shutil.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 @@ -3580,8 +3580,6 @@ def test_module_all_attribute(self):
if hasattr(os, 'statvfs') or os.name == 'nt':
target_api.append('disk_usage')
self.assertEqual(set(shutil.__all__), set(target_api))
with self.assertWarns(DeprecationWarning):
from shutil import ExecError # noqa: F401


if __name__ == '__main__':
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,2 @@
Remove the :exc:`!shutil.ExecError` exception which has been deprecated
since Python 3.14.
Loading

Back | FazBrowse Home | New Git URL