cube-browser-playwright 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cube_browser_playwright-0.2.0 → cube_browser_playwright-0.2.1}/PKG-INFO +1 -1
- {cube_browser_playwright-0.2.0 → cube_browser_playwright-0.2.1}/pyproject.toml +4 -1
- {cube_browser_playwright-0.2.0 → cube_browser_playwright-0.2.1}/src/cube_browser_playwright/playwright_session.py +7 -6
- {cube_browser_playwright-0.2.0 → cube_browser_playwright-0.2.1}/src/cube_browser_playwright/__init__.py +0 -0
- {cube_browser_playwright-0.2.0 → cube_browser_playwright-0.2.1}/src/cube_browser_playwright/async_playwright_session.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cube-browser-playwright"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "Concrete browser session implementations for cube-standard"
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
dependencies = [
|
|
@@ -39,3 +39,6 @@ extend-select = ["I"]
|
|
|
39
39
|
testpaths = ["tests"]
|
|
40
40
|
addopts = "-rs"
|
|
41
41
|
asyncio_mode = "auto"
|
|
42
|
+
|
|
43
|
+
[tool.uv.sources]
|
|
44
|
+
cube-standard = { workspace = true }
|
|
@@ -169,12 +169,13 @@ class PlaywrightSession(BrowserSession):
|
|
|
169
169
|
try:
|
|
170
170
|
self._context.close()
|
|
171
171
|
except Exception as e:
|
|
172
|
-
|
|
172
|
+
# "Event loop is closed" is expected when stop() is called during interpreter
|
|
173
|
+
# shutdown or after the sync-API event loop has already been torn down — not a leak.
|
|
174
|
+
if "Event loop is closed" not in str(e):
|
|
175
|
+
logger.error("Error closing browser context; resources may be leaked: %s", e)
|
|
173
176
|
try:
|
|
174
177
|
self._playwright.stop()
|
|
175
178
|
except Exception as e:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
except OSError as e:
|
|
180
|
-
logger.warning("Failed to remove temp profile dir %r: %s", self._user_data_dir, e)
|
|
179
|
+
if "Event loop is closed" not in str(e):
|
|
180
|
+
logger.error("Error stopping playwright; process may be leaked: %s", e)
|
|
181
|
+
shutil.rmtree(self._user_data_dir, ignore_errors=True)
|
|
File without changes
|