-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
py: Ensure DRIVER_PATH_ENV_KEY defaults to string #14862
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
py: Ensure DRIVER_PATH_ENV_KEY defaults to string #14862
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Maybe, based on this feedback, it'd be better to replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should default to an empty string imo so this can be merged!
Follow up to PR SeleniumHQ#14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor.
84f41bd to
a3812fa
Compare
|
Updated the patch to keep the recommendation of using "None" to indicate the absence of value. |
|
I think this change cause the following issue on Linux
|
(Formatted the trace for readability) I'm not sure how this PR could cause this. Can you provide more information? |
[py] Avoid os.getenv error if driver_path_env_key is not set Follow up to PR SeleniumHQ#14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor. Co-authored-by: Diego Molina <[email protected]>
User description
Description
Follow up to PR #14528, to avoid
os.getenvraisingTypeErrorinenv_pathwhendriver_path_env_keyis not passed toServiceconstructor.This happens, for example, with the WPEWebKit driver, which currently ignores
driver_path_env_key, as the executableWPEWebDriveris usually available on$PATH(which is set either natively or through other test scripts).Types of changes
Checklist
PR Type
Bug fix
Description
driver_path_env_keyin theServiceclass docstring.DRIVER_PATH_ENV_KEYto default to an empty string if not provided, preventingTypeErrorwhenos.getenvis called.driver_path_env_key.Changes walkthrough 📝
service.py
Ensure DRIVER_PATH_ENV_KEY defaults to an empty stringpy/selenium/webdriver/common/service.py
driver_path_env_key.DRIVER_PATH_ENV_KEYto an empty string.