mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #6074: Apply an appropriate fix for importlib based imports
This commit is contained in:
parent
90eb8ae6ce
commit
eb8d627bbd
4 changed files with 2008 additions and 1943 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue