summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-10-19 13:36:15 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-10-19 13:36:15 (GMT)
commitd4f5ad6c6e62150b02bc9f5ba97fd3cc4f3742ee (patch)
treee23ad5bcca3933f8894b6e0cc0a9274e43830149 /Lib/importlib
parent0772398a9ad729c125a5c06eedf90e35089c12ce (diff)
parenteb8d627bbdf5a6c0a467a598976b7ebfde50e49f (diff)
downloadcpython-d4f5ad6c6e62150b02bc9f5ba97fd3cc4f3742ee.zip
cpython-d4f5ad6c6e62150b02bc9f5ba97fd3cc4f3742ee.tar.gz
cpython-d4f5ad6c6e62150b02bc9f5ba97fd3cc4f3742ee.tar.bz2
Merge fix from #6074 from 3.3
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 8c83613..36f1c8f 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1048,6 +1048,9 @@ class SourceFileLoader(FileLoader, SourceLoader):
mode = _os.stat(source_path).st_mode
except OSError:
mode = 0o666
+ # We always ensure write access so we can update cached files
+ # later even when the source files are read-only on Windows (#6074)
+ mode |= 0o200
return self.set_data(bytecode_path, data, _mode=mode)
def set_data(self, path, data, *, _mode=0o666):