diff Python/import.c @ 55132:e9fc8947c49a legacy-trunk

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.
author R. David Murray <rdmurray@bitdance.com>
date Tue, 07 Jul 2009 01:06:13 +0000
parents 145376df3ad7
children adfd6b73d364
line wrap: on
line diff
--- a/Python/import.c	Mon Jul 06 12:50:46 2009 +0000
+++ b/Python/import.c	Tue Jul 07 01:06:13 2009 +0000
@@ -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) {