From ddb7468b112a227b4729458ec7b888134dfb2098 Mon Sep 17 00:00:00 2001 From: Samuel Montgomery-Blinn Date: Thu, 24 Apr 2025 15:58:49 -0400 Subject: [PATCH 1/2] Sometimes attrs["source"] is None And this results in an absolute wall of error messages in every robot log: ``` 20250424 14:20:05.655 ERROR Calling method '_start_keyword' of listener 'Browser' failed: TypeError: expected str, bytes or os.PathLike object, not NoneType 20250424 14:20:05.663 ERROR Calling method '_start_keyword' of listener 'Browser' failed: TypeError: expected str, bytes or os.PathLike object, not NoneType 20250424 14:20:05.671 ERROR Calling method '_start_keyword' of listener 'Browser' failed: TypeError: expected str, bytes or os.PathLike object, not NoneType 20250424 14:20:05.673 ERROR Calling method '_start_keyword' of listener 'Browser' failed: TypeError: expected str, bytes or os.PathLike object, not NoneType 20250424 14:20:05.694 ERROR Calling method '_start_keyword' of listener 'Browser' failed: TypeError: expected str, bytes or os.PathLike object, not NoneType ``` --- Browser/browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Browser/browser.py b/Browser/browser.py index 18e1781c3..68994d2aa 100755 --- a/Browser/browser.py +++ b/Browser/browser.py @@ -1182,7 +1182,7 @@ def _start_test(self, _name, attrs): logger.trace(f"Browser._start_test connection problem: {e}") def _resolve_path(self, attrs: dict) -> Union[Path, None]: - source = Path(attrs["source"]) + source = Path(attrs["source"]) if "source" in attrs and attrs["source"] is not None else None if source.is_dir(): source = source / "__init__.robot" if not source.exists(): From 2a30245eaf002a756eb1dcc2c99e2eac6b085f99 Mon Sep 17 00:00:00 2001 From: Samuel Montgomery-Blinn Date: Thu, 24 Apr 2025 16:01:45 -0400 Subject: [PATCH 2/2] Update browser.py --- Browser/browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Browser/browser.py b/Browser/browser.py index 68994d2aa..49ab41ed6 100755 --- a/Browser/browser.py +++ b/Browser/browser.py @@ -1183,7 +1183,7 @@ def _start_test(self, _name, attrs): def _resolve_path(self, attrs: dict) -> Union[Path, None]: source = Path(attrs["source"]) if "source" in attrs and attrs["source"] is not None else None - if source.is_dir(): + if source is not None and source.is_dir(): source = source / "__init__.robot" if not source.exists(): return None