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

Reproducible Build Test #1590

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion PyInstaller/archive/writers.py
Expand Up @@ -30,6 +30,8 @@
from types import CodeType
import marshal
import zlib
import copy
from operator import itemgetter

from .readers import CArchiveReader, PYZ_TYPE_MODULE, PYZ_TYPE_PKG, PYZ_TYPE_DATA
from ..compat import BYTECODE_MAGIC
Expand Down Expand Up @@ -222,7 +224,10 @@ def _add_from_table_of_contents(self, toc):
entry[2] is a flag for it's storage format (True or 1 if compressed)
entry[3] is the entry's type code.
"""
for toc_entry in toc:
toc2 = copy.copy(toc)
toc2.sort(key=itemgetter(0), reverse=False) # in place sort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A TOC is a list and lists are sorted by their first item anyway. No need for all this code. toc.sort() would to the same.


for toc_entry in toc2:
self.add(toc_entry) # The guts of the archive.

def _finalize(self):
Expand Down