summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-10-19 13:32:00 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-10-19 13:32:00 (GMT)
commiteb8d627bbdf5a6c0a467a598976b7ebfde50e49f (patch)
tree4d36ab361cf9bb941517d366f3a993cf307e2c59 /Lib/importlib
parent90eb8ae6ce1f723695953db3acc9ca8c861ab81e (diff)
downloadcpython-eb8d627bbdf5a6c0a467a598976b7ebfde50e49f.zip
cpython-eb8d627bbdf5a6c0a467a598976b7ebfde50e49f.tar.gz
cpython-eb8d627bbdf5a6c0a467a598976b7ebfde50e49f.tar.bz2
Issue #6074: Apply an appropriate fix for importlib based imports
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 8a20c5e..26d9250 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):