summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-07-19 01:44:23 +0000
committerR. David Murray <rdmurray@bitdance.com>2009-07-19 01:44:23 +0000
commite38b0a8ec071723f038e29c922e47e94c231eb13 (patch)
treebf76c12ac46c50f9e70a589c42dbc48228d620fe /Python
parent59f4c40ba2ed9bcf2c89af1b6be0d35e79fba3c4 (diff)
downloadcpython-git-e38b0a8ec071723f038e29c922e47e94c231eb13.tar.gz
Merged revisions 73870,73879,73899-73900,73905-73906 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73870 | r.david.murray | 2009-07-06 21:06:13 -0400 (Mon, 06 Jul 2009) | 5 lines 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. ........ r73879 | r.david.murray | 2009-07-07 05:54:16 -0400 (Tue, 07 Jul 2009) | 3 lines Update issue 6070 patch to match the patch that was actually tested on Windows. ........ r73899 | r.david.murray | 2009-07-08 21:43:41 -0400 (Wed, 08 Jul 2009) | 3 lines Conditionalize test cleanup code to eliminate traceback, which will hopefully reveal the real problem. ........ r73900 | r.david.murray | 2009-07-08 22:06:17 -0400 (Wed, 08 Jul 2009) | 2 lines Make test work with -O. ........ r73905 | r.david.murray | 2009-07-09 09:55:44 -0400 (Thu, 09 Jul 2009) | 3 lines Specify umask in execute bit test to get consistent results and make sure we test resetting all three execute bits. ........ r73906 | r.david.murray | 2009-07-09 11:35:33 -0400 (Thu, 09 Jul 2009) | 5 lines Curdir needs to be in the path for the test to work on all buildbots. (I copied this from another import test, but currently this will fail if TESTFN ends up in /tmp...see issue 2609). ........
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 5270b3771c..4846e1091a 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -879,7 +879,11 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
{
FILE *fp;
time_t mtime = srcstat->st_mtime;
- mode_t mode = srcstat->st_mode;
+#ifdef MS_WINDOWS /* since Windows uses different permissions */
+ mode_t mode = srcstat->st_mode & ~S_IEXEC;
+#else
+ mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+#endif
fp = open_exclusive(cpathname, mode);
if (fp == NULL) {