-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
install_addon() didn't take into account dir paths with trailing slashes #13694
Conversation
PR Description updated to latest commit (2017708)
|
PR Review
✨ Review tool usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
FYI, the related tests PR I sent were already merged: |
If install_addon() was called with a path argument pointing to to an extension directory and the path argument value itself ended with a trailing slash, install_addon() would eat the first character of each file it would be adding to the synthetized xpi file. Fixes #13685
suggested by codiumai-pr-agent-pro
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.
Thank you, @jkbzh!
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #13694 +/- ##
==========================================
- Coverage 58.48% 58.47% -0.02%
==========================================
Files 86 86
Lines 5270 5271 +1
Branches 220 220
==========================================
Hits 3082 3082
- Misses 1968 1969 +1
Partials 220 220 ☔ View full report in Codecov by Sentry. |
User description
If install_addon() was called with a path argument pointing to to an extension directory and the path argument value itself ended with a trailing slash, install_addon() would eat the first character of each file it would be adding to the synthetized xpi file.
Fixes #13685
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
install_addon() can be called given either a path to an xpi file or the path to the source code of an extension.
In the second case, install_addon() will create a temporary xpi file itself.
In the second case, if the given path ended with a slash, install_addon() would eat the first character
of each file that it was adding to the temporary xpi file.
The patch removes all trailing slashes from the path before processing, thus letting install_addon() work
regardless of whether a path pointing to a dir ends with a slash.
Motivation and Context
If the path ended with a slash, install_addon() would eat the first character of each file that it was adding to
the temporary xpi file.
Types of changes
Checklist
Type
bug_fix
Description
install_addon
where paths with trailing slashes caused the first character of each file to be omitted when creating a temporary xpi file.install_addon
works correctly regardless of whether a directory path ends with a slash by stripping trailing slashes and adjusting path root calculation.Changes walkthrough
webdriver.py
Fix Trailing Slash Issue in install_addon Method
py/selenium/webdriver/firefox/webdriver.py
install_addon
.path_root
calculation to account for the removal of trailingslashes.