From c65ba70c906fb7db6ff3ef83cafeec5cd2c1ed4a Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Tue, 18 Nov 2025 17:03:00 -0500 Subject: [PATCH 1/3] Remove broken ldd implementation --- src/choreographer/browser_async.py | 7 +---- src/choreographer/browsers/__init__.py | 2 +- src/choreographer/browsers/_errors.py | 1 + src/choreographer/browsers/chromium.py | 41 -------------------------- 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/src/choreographer/browser_async.py b/src/choreographer/browser_async.py index a0900a38..df24bdf5 100644 --- a/src/choreographer/browser_async.py +++ b/src/choreographer/browser_async.py @@ -14,7 +14,7 @@ from choreographer import protocol from ._brokers import Broker -from .browsers import BrowserClosedError, BrowserDepsError, BrowserFailedError, Chromium +from .browsers import BrowserClosedError, BrowserFailedError, Chromium from .channels import ChannelClosedError, Pipe from .protocol.devtools_async import Session, Target from .utils import TmpDirWarning, _manual_thread_pool @@ -166,11 +166,6 @@ def run() -> subprocess.Popen[bytes] | subprocess.Popen[str]: # depends on args await asyncio.sleep(0) # let watchdog start await self.populate_targets() except (BrowserClosedError, BrowserFailedError, asyncio.CancelledError) as e: - if ( - hasattr(self._browser_impl, "missing_libs") - and self._browser_impl.missing_libs # type: ignore[reportAttributeAccessIssue] - ): - raise BrowserDepsError from e raise BrowserFailedError( "The browser seemed to close immediately after starting.", "You can set the `logging.Logger` level lower to see more output.", diff --git a/src/choreographer/browsers/__init__.py b/src/choreographer/browsers/__init__.py index a4680847..df8da1a8 100644 --- a/src/choreographer/browsers/__init__.py +++ b/src/choreographer/browsers/__init__.py @@ -1,6 +1,6 @@ """Contains implementations of browsers that choreographer can open.""" -from ._errors import BrowserClosedError, BrowserDepsError, BrowserFailedError +from ._errors import BrowserClosedError, BrowserFailedError from .chromium import ChromeNotFoundError, Chromium __all__ = [ diff --git a/src/choreographer/browsers/_errors.py b/src/choreographer/browsers/_errors.py index f1ed1780..c0397f4d 100644 --- a/src/choreographer/browsers/_errors.py +++ b/src/choreographer/browsers/_errors.py @@ -6,6 +6,7 @@ class BrowserFailedError(RuntimeError): """An error for when the browser fails to launch.""" +# not currently used but keeping copy + not breaking API class BrowserDepsError(BrowserFailedError): """An error for when the browser is closed because of missing libs.""" diff --git a/src/choreographer/browsers/chromium.py b/src/choreographer/browsers/chromium.py index 73b46421..447b3b1d 100644 --- a/src/choreographer/browsers/chromium.py +++ b/src/choreographer/browsers/chromium.py @@ -115,46 +115,6 @@ def logger_parser( return True - def _libs_ok(self) -> bool: - """Return true if libs ok.""" - if self.skip_local: - _logger.debug( - "If we HAVE to skip local.", - ) - return True - _logger.debug("Checking for libs needed.") - if platform.system() != "Linux": - _logger.debug("We're not in linux, so no need for check.") - return True - p = None - try: - _logger.debug(f"Trying ldd {self.path}") - p = subprocess.run( # noqa: S603, validating run with variables - [ # noqa: S607 path is all we have - "ldd", - str(self.path), - ], - capture_output=True, - timeout=5, - check=True, - ) - except Exception as e: # noqa: BLE001 - msg = "ldd failed." - stderr = p.stderr.decode() if p and p.stderr else None - # Log failure as INFO rather than WARNING so that it's hidden by default, - # since browser may succeed even if ldd fails - _logger.info( - msg # noqa: G003 + in log - + f" e: {e}, stderr: {stderr}", - ) - return False - if b"not found" in p.stdout: - msg = "Found deps missing in chrome" - _logger.debug2(msg + f" {p.stdout.decode()}") - return False - _logger.debug("No problems found with dependencies") - return True - def __init__( self, channel: ChannelInterface, @@ -220,7 +180,6 @@ def pre_open(self) -> None: path=self._tmp_dir_path, sneak=self._is_isolated, ) - self.missing_libs = not self._libs_ok() _logger.info(f"Temporary directory at: {self.tmp_dir.path}") def is_isolated(self) -> bool: From 5bd054aacf461a95320983925e4943eb84dab6e8 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Tue, 18 Nov 2025 17:04:10 -0500 Subject: [PATCH 2/3] Send changelog --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cd77c98a..876f9a83 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,4 @@ +- Remove unused system inspection code v1.2.1 - Use custom threadpool for functions that could be running during shutdown: Python's stdlib threadpool isn't available during interpreter shutdown, nor From c1e8663ea6e3a2ec4824b1b124c4c159f07173d3 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Tue, 18 Nov 2025 19:42:57 -0500 Subject: [PATCH 3/3] Restore documented export --- src/choreographer/browsers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/choreographer/browsers/__init__.py b/src/choreographer/browsers/__init__.py index df8da1a8..a4680847 100644 --- a/src/choreographer/browsers/__init__.py +++ b/src/choreographer/browsers/__init__.py @@ -1,6 +1,6 @@ """Contains implementations of browsers that choreographer can open.""" -from ._errors import BrowserClosedError, BrowserFailedError +from ._errors import BrowserClosedError, BrowserDepsError, BrowserFailedError from .chromium import ChromeNotFoundError, Chromium __all__ = [