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

Prevent MERGE from creating self-references for duplicated TOC entries #5652

Merged
merged 1 commit into from Mar 27, 2021
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions PyInstaller/building/api.py
Expand Up @@ -822,6 +822,17 @@ def _set_dependencies(self, analysis, path):
self._dependencies[tpl[1]] = path
else:
dep_path = self._get_relative_path(path, self._dependencies[tpl[1]])
# Ignore references that point to the origin package.
# This can happen if the same resource is listed
# multiple times in TOCs (e.g., once as binary and
# once as data).
if dep_path.endswith(path):
logger.debug("Ignoring self-reference of %s for %s, "
"located in %s - duplicated TOC entry?",
tpl[1], path, dep_path)
# Clear the entry as it is a duplicate.
toc[i] = (None, None, None)
continue
logger.debug("Referencing %s to be a dependecy for %s, located in %s" % (tpl[1], path, dep_path))
# Determine the path relative to dep_path (i.e, within
# the target directory) from the 'name' component
Expand Down
2 changes: 2 additions & 0 deletions news/5652.bugfix.rst
@@ -0,0 +1,2 @@
Prevent ``MERGE`` (multipackage) from creating self-references for
duplicated TOC entries.