diff --git a/HISTORY.rst b/HISTORY.rst index 2428f033a..6b2a23f79 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -41,10 +41,10 @@ XXXX-XX-XX - 1439_: [NetBSD] Process.connections() may return incomplete results if using oneshot() -**API changes** +**Incompatible API changes** -- 1291_: [OSX] Process.memory_maps() is deprecated and will always raise - AccessDenied. It will be removed in psutil 6.0.0. +- 1291_: [OSX] Process.memory_maps() was removed because inherently broken + (segfault) for years. 5.5.1 ===== diff --git a/docs/index.rst b/docs/index.rst index 6d464c854..73a81cdbf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1708,14 +1708,9 @@ Process class Availability: Linux, Windows, FreeBSD, SunOS - .. warning:: - on macOS, starting from version 5.6.0, this function is deprecated and - will always raise :class:`psutil.AccessDenied`. It is scheduled for - removal in 6.0.0 - (see `issue 1020 `_). - .. versionchanged:: - 5.6.0 deprecated on macOS, always raise AccessDenied + 5.6.0 removed macOS support because inherently broken (see + issue `#1291 `__) .. method:: children(recursive=False) diff --git a/psutil/_psosx.py b/psutil/_psosx.py index 78f710aa3..20c05612a 100644 --- a/psutil/_psosx.py +++ b/psutil/_psosx.py @@ -8,7 +8,6 @@ import errno import functools import os -import warnings from socket import AF_INET from collections import namedtuple @@ -575,8 +574,3 @@ def threads(self): ntuple = _common.pthread(thread_id, utime, stime) retlist.append(ntuple) return retlist - - def memory_maps(self): - msg = "memory_maps() on OSX is deprecated and will be removed in 6.0.0" - warnings.warn(msg, category=DeprecationWarning, stacklevel=2) - raise AccessDenied(self.pid, msg=msg) diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 86af2cfb5..545f5f251 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -167,7 +167,7 @@ HAS_PROC_IO_COUNTERS = hasattr(psutil.Process, "io_counters") HAS_IONICE = hasattr(psutil.Process, "ionice") HAS_MEMORY_FULL_INFO = 'uss' in psutil.Process().memory_full_info()._fields -HAS_MEMORY_MAPS = not MACOS and hasattr(psutil.Process, "memory_maps") +HAS_MEMORY_MAPS = hasattr(psutil.Process, "memory_maps") HAS_PROC_CPU_NUM = hasattr(psutil.Process, "cpu_num") HAS_RLIMIT = hasattr(psutil.Process, "rlimit") HAS_THREADS = hasattr(psutil.Process, "threads") diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py index 97a1a0f06..1f02156f3 100755 --- a/psutil/tests/test_contracts.py +++ b/psutil/tests/test_contracts.py @@ -167,7 +167,8 @@ def test_proc_cpu_num(self): def test_proc_memory_maps(self): hasit = hasattr(psutil.Process, "memory_maps") - self.assertEqual(hasit, False if OPENBSD or NETBSD or AIX else True) + self.assertEqual( + hasit, False if OPENBSD or NETBSD or AIX or MACOS else True) # =================================================================== @@ -185,14 +186,6 @@ def test_memory_info_ex(self): self.assertIn("memory_info_ex() is deprecated", str(w.message)) self.assertIn("use memory_info() instead", str(w.message)) - @unittest.skipIf(not MACOS, "deprecated on macOS") - def test_memory_maps_osx(self): - with warnings.catch_warnings(record=True) as ws: - with self.assertRaises(psutil.AccessDenied): - psutil.Process().memory_maps() - w = ws[0] - self.assertIsInstance(w.category(), DeprecationWarning) - # =================================================================== # --- System API types diff --git a/psutil/tests/test_memory_leaks.py b/psutil/tests/test_memory_leaks.py index 161285716..07d7f0680 100755 --- a/psutil/tests/test_memory_leaks.py +++ b/psutil/tests/test_memory_leaks.py @@ -344,8 +344,6 @@ def test_open_files(self): with open(TESTFN, 'w'): self.execute(self.proc.open_files) - # MACOS implementation is unbelievably slow - @unittest.skipIf(MACOS, "too slow on MACOS") @unittest.skipIf(not HAS_MEMORY_MAPS, "not supported") @skip_if_linux() def test_memory_maps(self): diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index 31f42ebaa..2af676ba9 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -1291,8 +1291,6 @@ def test_halfway_terminated_process(self): ret = meth([0]) elif name == 'send_signal': ret = meth(signal.SIGTERM) - elif MACOS and name == 'memory_maps': - continue # XXX else: ret = meth() except psutil.ZombieProcess: