Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Webdriver has mutable default value #1817

Closed
Snooz82 opened this issue Feb 23, 2023 — with Slack · 3 comments
Closed

Create Webdriver has mutable default value #1817

Snooz82 opened this issue Feb 23, 2023 — with Slack · 3 comments
Assignees
Labels
acknowledge To be acknowledged in release notes bug priority: critical rc 1
Milestone

Comments

Copy link
Member

Snooz82 commented Feb 23, 2023

In src/SeleniumLibrary/keywords/browsermanagement.py

    @keyword
    def create_webdriver(
        self, driver_name: str, alias: Optional[str] = None, kwargs={}, **init_kwargs
    ) -> str:

the dictionary in kwargs should be replaced by None

https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/

@emanlove
Copy link
Member

René, do you catch this with a linker/black?

@emanlove emanlove added this to the V6.2.0 milestone May 18, 2023
@Snooz82
Copy link
Member Author

Snooz82 commented Jun 18, 2023

@emanlove yes linter do catch this.

i can highly recommend ruff as a linter. It is amazingly fast and replaces isort and works well with black.

you can start with the config that Browser lib has in its pyproject.toml.

@emanlove emanlove self-assigned this Aug 16, 2023
@emanlove emanlove modified the milestones: v6.2.0, v6.1.4 Nov 17, 2023
@emanlove emanlove added bug priority: critical acknowledge To be acknowledged in release notes and removed in progress labels Nov 18, 2023
@emanlove
Copy link
Member

Fixed in #1859

@emanlove emanlove modified the milestones: v6.1.4, v6.2.0 Nov 19, 2023
@emanlove emanlove added the rc 1 label Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge To be acknowledged in release notes bug priority: critical rc 1
Projects
None yet
Development

No branches or pull requests

2 participants