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

[🐛 Bug]: Firefox ZIP timestamps, part 2 #15138

Open
martin-djukanovic opened this issue Jan 23, 2025 · 1 comment · May be fixed by #15141
Open

[🐛 Bug]: Firefox ZIP timestamps, part 2 #15138

martin-djukanovic opened this issue Jan 23, 2025 · 1 comment · May be fixed by #15141

Comments

@martin-djukanovic
Copy link

What happened?

A virtual duplicate of #14143, but it's a different file this time. The offending line is 134 in py/selenium/webdriver/firefox/webdriver.py

It should be changed from
with zipfile.ZipFile(fp, "w", zipfile.ZIP_DEFLATED) as zipped:
to
with zipfile.ZipFile(fp, "w", zipfile.ZIP_DEFLATED, strict_timestamps=False) as zipped:

How can we reproduce the issue?

1) Download a Firefox addon
2) Unzip the .xpi file to a directory
3) Pass the directory path to driver.install_addon()

Relevant log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/webdriver.py", line 134, in install_addon
    zipped.write(filename, filename[path_root:])
  File "/usr/lib/python3.12/zipfile/__init__.py", line 1841, in write
    zinfo = ZipInfo.from_file(filename, arcname,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/zipfile/__init__.py", line 573, in from_file
    zinfo = cls(arcname, date_time)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/zipfile/__init__.py", line 398, in __init__
    raise ValueError('ZIP does not support timestamps before 1980')
ValueError: ZIP does not support timestamps before 1980

Operating System

Ubuntu

Selenium version

Python 4.28.0

What are the browser(s) and version(s) where you see this issue?

Firefox 134

What are the browser driver(s) and version(s) where you see this issue?

GeckoDriver 0.35.0

Are you using Selenium Grid?

No response

Copy link

@martin-djukanovic, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@Delta456 Delta456 linked a pull request Jan 23, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant