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

archive: fix stored paths when building under MSYS #5569

Merged
merged 1 commit into from Feb 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
6 changes: 5 additions & 1 deletion PyInstaller/archive/writers.py
Expand Up @@ -35,7 +35,7 @@
fake_pyc_timestamp
from PyInstaller.loader.pyimod02_archive import PYZ_TYPE_MODULE, PYZ_TYPE_PKG, \
PYZ_TYPE_DATA, PYZ_TYPE_NSPKG
from ..compat import BYTECODE_MAGIC, is_py37
from ..compat import BYTECODE_MAGIC, is_py37, is_win


class ArchiveWriter(object):
Expand Down Expand Up @@ -283,6 +283,10 @@ def add(self, dpos, dlen, ulen, flag, typcd, nm):
# slashes '\\' since on Windows the bootloader works only with back
# slashes.
nm = os.path.normpath(nm)
if is_win and os.path.sep == '/':
# When building under MSYS, the above path normalization
# uses Unix-style separators, so replace them manually.
nm = nm.replace(os.path.sep, '\\')
self.data.append((dpos, dlen, ulen, flag, typcd, nm))


Expand Down
2 changes: 2 additions & 0 deletions news/5569.bugfix.rst
@@ -0,0 +1,2 @@
Fix extraction of nested files in ``onefile`` builds created in MSYS
environments.