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

adding mtime option to gzip open() #91372

Open
ellaellela mannequin opened this issue Apr 4, 2022 · 1 comment
Open

adding mtime option to gzip open() #91372

ellaellela mannequin opened this issue Apr 4, 2022 · 1 comment
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ellaellela
Copy link
Mannequin

ellaellela mannequin commented Apr 4, 2022

BPO 47216
Nosy @ellaellela
PRs
  • gh-91372: add mtime to gzip.open #32310
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2022-04-04.17:47:01.278>
    labels = ['type-feature', 'library', '3.11']
    title = 'adding mtime option to gzip open()'
    updated_at = <Date 2022-04-04.17:48:26.627>
    user = 'https://github.com/ellaellela'

    bugs.python.org fields:

    activity = <Date 2022-04-04.17:48:26.627>
    actor = 'ellaellela'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-04-04.17:47:01.278>
    creator = 'ellaellela'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47216
    keywords = ['patch']
    message_count = 1.0
    messages = ['416685']
    nosy_count = 1.0
    nosy_names = ['ellaellela']
    pr_nums = ['32310']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47216'
    versions = ['Python 3.11']

    @ellaellela
    Copy link
    Mannequin Author

    ellaellela mannequin commented Apr 4, 2022

    init of class GzipFile has mtime as an optional argument, but open() function does not.

    When using open(), mtime will always be set to the current time and so far there was no way of fixing it to a specific timestamp.

    In case two people would tar.gz the same file and take its sha, the shas would be different. With an option to fix the mtime, they could have a unique sha.

    PR containing code change and the tests is already ready.

    @ellaellela ellaellela mannequin added 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Apr 4, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    iyanmv added a commit to iyanmv/fwupd that referenced this issue Nov 16, 2023
    Python script generate-build/generate-quirk-builtin.py uses gzip to
    generate the builtin.quirk.gz artifact during building. A timestamp is
    appended to the file, making fwupd unreproducible as can be seen by the
    diffoscope log here:
    
    https://reproducible.archlinux.org/api/v0/builds/534033/diffoscope
    
    Until gzip.open() supports mtime (see python/cpython#91372), I suggest
    using gzip.GZipFile() instead and passing mtime=0. This generates the
    same file without embedding a timestamp.
    hughsie pushed a commit to fwupd/fwupd that referenced this issue Nov 16, 2023
    Python script generate-build/generate-quirk-builtin.py uses gzip to
    generate the builtin.quirk.gz artifact during building. A timestamp is
    appended to the file, making fwupd unreproducible as can be seen by the
    diffoscope log here:
    
    https://reproducible.archlinux.org/api/v0/builds/534033/diffoscope
    
    Until gzip.open() supports mtime (see python/cpython#91372), I suggest
    using gzip.GZipFile() instead and passing mtime=0. This generates the
    same file without embedding a timestamp.
    SherlockChu219 pushed a commit to fwupd/fwupd that referenced this issue Nov 17, 2023
    Python script generate-build/generate-quirk-builtin.py uses gzip to
    generate the builtin.quirk.gz artifact during building. A timestamp is
    appended to the file, making fwupd unreproducible as can be seen by the
    diffoscope log here:
    
    https://reproducible.archlinux.org/api/v0/builds/534033/diffoscope
    
    Until gzip.open() supports mtime (see python/cpython#91372), I suggest
    using gzip.GZipFile() instead and passing mtime=0. This generates the
    same file without embedding a timestamp.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    Status: No status
    Development

    No branches or pull requests

    0 participants