diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-09-10 02:32:45 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-09-10 02:32:45 (GMT) |
commit | ae69de658e7ca60c903b9e687ce3923617e058af (patch) | |
tree | 6c402930688659d88c5bd455e7df56959e922259 /Tools/msi | |
parent | 29bf4d403dd2cb8875e224f50a4cfeea177d33ae (diff) | |
download | cpython-ae69de658e7ca60c903b9e687ce3923617e058af.zip cpython-ae69de658e7ca60c903b9e687ce3923617e058af.tar.gz cpython-ae69de658e7ca60c903b9e687ce3923617e058af.tar.bz2 |
Fixes handling of read-only files when creating zip package.
Diffstat (limited to 'Tools/msi')
-rw-r--r-- | Tools/msi/make_zip.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index 09ee491..c256008 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -3,6 +3,7 @@ import py_compile import re import sys import shutil +import stat import os import tempfile @@ -101,11 +102,16 @@ def copy_to_layout(target, rel_sources): else: for s, rel in rel_sources: + dest = target / rel try: - (target / rel).parent.mkdir(parents=True) + dest.parent.mkdir(parents=True) except FileExistsError: pass - shutil.copy(str(s), str(target / rel)) + if dest.is_file(): + dest.chmod(stat.S_IWRITE) + shutil.copy(str(s), str(dest)) + if dest.is_file(): + dest.chmod(stat.S_IWRITE) count += 1 return count |