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.
diff --git a/Python/import.c b/Python/import.c
index 88aced0..46a1acc 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -881,7 +881,9 @@
{
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) {