Kaydet (Commit) ae69de65 authored tarafından Steve Dower's avatar Steve Dower

Fixes handling of read-only files when creating zip package.

üst 29bf4d40
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment