fix: fix `BrowserPool` and `PlaywrightBrowserPlugin` closure by Mantisus · Pull Request #932 · apify/crawlee-python

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@Mantisus

Copy link

Collaborator

Description

  • Fix the BrowserPool and PlaywrightBrowserPlugin closures. Without it, the application crashes when PlaywrightCrawler is run in sequence again.

@Mantisus

Copy link

Collaborator Author

Mantisus commented

Jan 24, 2025

edited

Loading

self._playwright_context_manager = async_playwright()

in PlaywrightBrowserPlugin.__aexit__ is needed because Playwright sets a flag that the manager has been closed - https://github.com/microsoft/playwright-python/blob/main/playwright/async_api/_context_manager.py#L56

Copy link

Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @Mantisus

Mantisus reacted with hooray emoji

@vdusek vdusek merged commit 997543d into apify:master

Jan 29, 2025

23 checks passed

@vdusek vdusek added bug

Something isn't working.

t-tooling

Issues with this label are in the ownership of the tooling team.

labels

Jan 29, 2025

@vdusek vdusek added this to the 107th sprint - Tooling team milestone

Jan 29, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vdusek vdusek vdusek approved these changes

@Pijukatel Pijukatel Pijukatel approved these changes

Assignees

@Mantisus Mantisus

Labels

bug

Something isn't working.

t-tooling

Issues with this label are in the ownership of the tooling team.

Projects

None yet

Milestone

107th sprint - Tooling team

Development

Successfully merging this pull request may close these issues.

3 participants

@Mantisus @vdusek @Pijukatel