Skip to content

[πŸ› Bug]: Firefox ZIP timestamps, part 2Β #15138

@martin-djukanovic

Description

@martin-djukanovic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions