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
97cabb9f
Kaydet (Commit)
97cabb9f
authored
Kas 20, 2015
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #25583: Merge makedirs fix from 3.4 into 3.5
üst
82f9feaf
a82642f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
os.py
Lib/os.py
+5
-3
test_os.py
Lib/test/test_os.py
+3
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/os.py
Dosyayı görüntüle @
97cabb9f
...
@@ -230,7 +230,7 @@ def makedirs(name, mode=0o777, exist_ok=False):
...
@@ -230,7 +230,7 @@ def makedirs(name, mode=0o777, exist_ok=False):
try
:
try
:
makedirs
(
head
,
mode
,
exist_ok
)
makedirs
(
head
,
mode
,
exist_ok
)
except
FileExistsError
:
except
FileExistsError
:
#
be happy if someone already
created the path
#
Defeats race condition when another thread
created the path
pass
pass
cdir
=
curdir
cdir
=
curdir
if
isinstance
(
tail
,
bytes
):
if
isinstance
(
tail
,
bytes
):
...
@@ -239,8 +239,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
...
@@ -239,8 +239,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
return
return
try
:
try
:
mkdir
(
name
,
mode
)
mkdir
(
name
,
mode
)
except
OSError
as
e
:
except
OSError
:
if
not
exist_ok
or
e
.
errno
!=
errno
.
EEXIST
or
not
path
.
isdir
(
name
):
# Cannot rely on checking for EEXIST, since the operating system
# could give priority to other errors like EACCES or EROFS
if
not
exist_ok
or
not
path
.
isdir
(
name
):
raise
raise
def
removedirs
(
name
):
def
removedirs
(
name
):
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
97cabb9f
...
@@ -1040,6 +1040,9 @@ class MakedirTests(unittest.TestCase):
...
@@ -1040,6 +1040,9 @@ class MakedirTests(unittest.TestCase):
os
.
makedirs
(
path
,
mode
=
mode
,
exist_ok
=
True
)
os
.
makedirs
(
path
,
mode
=
mode
,
exist_ok
=
True
)
os
.
umask
(
old_mask
)
os
.
umask
(
old_mask
)
# Issue #25583: A drive root could raise PermissionError on Windows
os
.
makedirs
(
os
.
path
.
abspath
(
'/'
),
exist_ok
=
True
)
def
test_exist_ok_s_isgid_directory
(
self
):
def
test_exist_ok_s_isgid_directory
(
self
):
path
=
os
.
path
.
join
(
support
.
TESTFN
,
'dir1'
)
path
=
os
.
path
.
join
(
support
.
TESTFN
,
'dir1'
)
S_ISGID
=
stat
.
S_ISGID
S_ISGID
=
stat
.
S_ISGID
...
...
Misc/NEWS
Dosyayı görüntüle @
97cabb9f
...
@@ -77,6 +77,9 @@ Core and Builtins
...
@@ -77,6 +77,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
25583
:
Avoid
incorrect
errors
raised
by
os
.
makedirs
(
exist_ok
=
True
)
when
the
OS
gives
priority
to
errors
such
as
EACCES
over
EEXIST
.
-
Issue
#
25593
:
Change
semantics
of
EventLoop
.
stop
()
in
asyncio
.
-
Issue
#
25593
:
Change
semantics
of
EventLoop
.
stop
()
in
asyncio
.
-
Issue
#
6973
:
When
we
know
a
subprocess
.
Popen
process
has
died
,
do
-
Issue
#
6973
:
When
we
know
a
subprocess
.
Popen
process
has
died
,
do
...
...
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