mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Issue 6070: when creating a compiled file, after copying the mode bits, on
posix zap the execute bit in case it was set on the .py file, since the compiled files are not directly executable on posix. Patch by Marco N.
This commit is contained in:
parent
e670e5ad5b
commit
23a736a4f0
3 changed files with 25 additions and 1 deletions
|
@ -881,7 +881,9 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
|
|||
{
|
||||
FILE *fp;
|
||||
time_t mtime = srcstat->st_mtime;
|
||||
mode_t mode = srcstat->st_mode;
|
||||
#ifndef MS_WINDOWS
|
||||
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
|
||||
#endif
|
||||
|
||||
fp = open_exclusive(cpathname, mode);
|
||||
if (fp == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue