diff --git a/py/selenium/webdriver/firefox/webdriver.py b/py/selenium/webdriver/firefox/webdriver.py index 574f2ee77db6c..75b387c865fc8 100644 --- a/py/selenium/webdriver/firefox/webdriver.py +++ b/py/selenium/webdriver/firefox/webdriver.py @@ -125,7 +125,10 @@ def install_addon(self, path, temporary=False) -> str: if os.path.isdir(path): fp = BytesIO() - path_root = len(path) + 1 # account for trailing slash + # filter all trailing slash found in path + path = os.path.normpath(path) + # account for trailing slash that will be added by os.walk() + path_root = len(path) + 1 with zipfile.ZipFile(fp, "w", zipfile.ZIP_DEFLATED) as zipped: for base, _, files in os.walk(path): for fyle in files: