Issue #6074: Apply an appropriate fix for importlib based imports

This commit is contained in:
Nick Coghlan 2012-10-19 23:32:00 +10:00
parent 90eb8ae6ce
commit eb8d627bbd
4 changed files with 2008 additions and 1943 deletions

View file

@ -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):