Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0c929d9d
Kaydet (Commit)
0c929d9d
authored
Kas 10, 2011
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #13303: Fix bytecode file default permission.
üst
1db7c13b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
17 deletions
+13
-17
_bootstrap.py
Lib/importlib/_bootstrap.py
+1
-1
test_import.py
Lib/test/test_import.py
+7
-10
import.c
Python/import.c
+5
-6
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
0c929d9d
...
...
@@ -88,7 +88,7 @@ def _write_atomic(path, data):
# On POSIX-like platforms, renaming is atomic. id() is used to generate
# a pseudo-random filename.
path_tmp
=
'{}.{}'
.
format
(
path
,
id
(
path
))
fd
=
_os
.
open
(
path_tmp
,
_os
.
O_EXCL
|
_os
.
O_CREAT
|
_os
.
O_WRONLY
)
fd
=
_os
.
open
(
path_tmp
,
_os
.
O_EXCL
|
_os
.
O_CREAT
|
_os
.
O_WRONLY
,
0
o666
)
try
:
with
_io
.
FileIO
(
fd
,
'wb'
)
as
file
:
file
.
write
(
data
)
...
...
Lib/test/test_import.py
Dosyayı görüntüle @
0c929d9d
...
...
@@ -97,25 +97,22 @@ class ImportTests(unittest.TestCase):
@unittest.skipUnless
(
os
.
name
==
'posix'
,
"test meaningful only on posix systems"
)
def
test_execute_bit_not_copied
(
self
):
# Issue 6070: under posix .pyc files got their execute bit set if
# the .py file had the execute bit set, but they aren't executable.
with
temp_umask
(
0
o022
):
def
test_creation_mode
(
self
):
mask
=
0
o022
with
temp_umask
(
mask
):
sys
.
path
.
insert
(
0
,
os
.
curdir
)
try
:
fname
=
TESTFN
+
os
.
extsep
+
"py"
create_empty_file
(
fname
)
os
.
chmod
(
fname
,
(
stat
.
S_IRUSR
|
stat
.
S_IRGRP
|
stat
.
S_IROTH
|
stat
.
S_IXUSR
|
stat
.
S_IXGRP
|
stat
.
S_IXOTH
))
__import__
(
TESTFN
)
fn
=
imp
.
cache_from_source
(
fname
)
if
not
os
.
path
.
exists
(
fn
):
self
.
fail
(
"__import__ did not result in creation of "
"either a .pyc or .pyo file"
)
s
=
os
.
stat
(
fn
)
self
.
assertEqual
(
stat
.
S_IMODE
(
s
.
st_mode
),
stat
.
S_IRUSR
|
stat
.
S_IRGRP
|
stat
.
S_IROTH
)
s
=
os
.
stat
(
fn
)
# Check that the umask is respected, and the executable bits
# aren't set.
self
.
assertEqual
(
stat
.
S_IMODE
(
s
.
st_mode
),
0
o666
&
~
mask
)
finally
:
del
sys
.
path
[
0
]
remove_files
(
TESTFN
)
...
...
Python/import.c
Dosyayı görüntüle @
0c929d9d
...
...
@@ -1202,12 +1202,10 @@ write_compiled_module(PyCodeObject *co, PyObject *cpathname,
S_IXUSR
|
S_IXGRP
|
S_IXOTH
|
S_IWUSR
|
S_IWGRP
|
S_IWOTH
);
PyObject
*
dirbytes
;
#endif
int
fd
;
#ifndef MS_WINDOWS
PyObject
*
cpathbytes
,
*
cpathbytes_tmp
;
Py_ssize_t
cpathbytes_len
;
#endif
int
fd
;
PyObject
*
dirname
;
Py_UCS4
*
dirsep
;
int
res
,
ok
;
...
...
@@ -1275,7 +1273,7 @@ write_compiled_module(PyCodeObject *co, PyObject *cpathname,
return
;
}
cpathbytes_len
=
PyBytes_GET_SIZE
(
cpathbytes
);
cpathbytes_tmp
=
PyBytes_FromStringAndSize
(
NULL
,
cpathbytes_len
+
6
);
cpathbytes_tmp
=
PyBytes_FromStringAndSize
(
NULL
,
cpathbytes_len
+
4
);
if
(
cpathbytes_tmp
==
NULL
)
{
Py_DECREF
(
cpathbytes
);
PyErr_Clear
();
...
...
@@ -1283,9 +1281,10 @@ write_compiled_module(PyCodeObject *co, PyObject *cpathname,
}
memcpy
(
PyBytes_AS_STRING
(
cpathbytes_tmp
),
PyBytes_AS_STRING
(
cpathbytes
),
cpathbytes_len
);
memcpy
(
PyBytes_AS_STRING
(
cpathbytes_tmp
)
+
cpathbytes_len
,
"
XXXXXX"
,
6
);
memcpy
(
PyBytes_AS_STRING
(
cpathbytes_tmp
)
+
cpathbytes_len
,
"
.tmp"
,
4
);
fd
=
mkstemp
(
PyBytes_AS_STRING
(
cpathbytes_tmp
));
fd
=
open
(
PyBytes_AS_STRING
(
cpathbytes_tmp
),
O_CREAT
|
O_EXCL
|
O_WRONLY
,
0666
);
if
(
0
<=
fd
)
fp
=
fdopen
(
fd
,
"wb"
);
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment