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
4e67838d
Kaydet (Commit)
4e67838d
authored
Tem 30, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
üst
e34ac7ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
shutil.py
Lib/shutil.py
+7
-1
test_shutil.py
Lib/test/test_shutil.py
+27
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/shutil.py
Dosyayı görüntüle @
4e67838d
...
...
@@ -127,7 +127,13 @@ def copytree(src, dst, symlinks=False):
# continue with other files
except
Error
,
err
:
errors
.
extend
(
err
.
args
[
0
])
copystat
(
src
,
dst
)
try
:
copystat
(
src
,
dst
)
except
WindowsError
:
# can't copy file access times on Windows
pass
except
OSError
,
why
:
errors
.
extend
((
src
,
dst
,
str
(
why
)))
if
errors
:
raise
Error
,
errors
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
4e67838d
...
...
@@ -74,6 +74,33 @@ class TestShutil(unittest.TestCase):
except
:
pass
def
test_copytree_simple
(
self
):
src_dir
=
tempfile
.
mkdtemp
()
dst_dir
=
os
.
path
.
join
(
tempfile
.
mkdtemp
(),
'destination'
)
open
(
os
.
path
.
join
(
src_dir
,
'test.txt'
),
'w'
)
.
write
(
'123'
)
os
.
mkdir
(
os
.
path
.
join
(
src_dir
,
'test_dir'
))
open
(
os
.
path
.
join
(
src_dir
,
'test_dir'
,
'test.txt'
),
'w'
)
.
write
(
'456'
)
#
try
:
shutil
.
copytree
(
src_dir
,
dst_dir
)
self
.
assertTrue
(
os
.
path
.
isfile
(
os
.
path
.
join
(
dst_dir
,
'test.txt'
)))
self
.
assertTrue
(
os
.
path
.
isdir
(
os
.
path
.
join
(
dst_dir
,
'test_dir'
)))
self
.
assertTrue
(
os
.
path
.
isfile
(
os
.
path
.
join
(
dst_dir
,
'test_dir'
,
'test.txt'
)))
self
.
assertEqual
(
open
(
os
.
path
.
join
(
dst_dir
,
'test.txt'
))
.
read
(),
'123'
)
self
.
assertEqual
(
open
(
os
.
path
.
join
(
dst_dir
,
'test_dir'
,
'test.txt'
))
.
read
(),
'456'
)
finally
:
try
:
os
.
remove
(
os
.
path
.
join
(
src_dir
,
'test.txt'
))
os
.
remove
(
os
.
path
.
join
(
dst_dir
,
'test.txt'
))
os
.
remove
(
os
.
path
.
join
(
src_dir
,
'test_dir'
,
'test.txt'
))
os
.
remove
(
os
.
path
.
join
(
dst_dir
,
'test_dir'
,
'test.txt'
))
os
.
removedirs
(
src_dir
)
os
.
removedirs
(
dst_dir
)
except
:
pass
if
hasattr
(
os
,
"symlink"
):
def
test_dont_copy_file_onto_link_to_itself
(
self
):
# bug 851123.
...
...
Misc/NEWS
Dosyayı görüntüle @
4e67838d
...
...
@@ -61,6 +61,9 @@ Core and builtins
Library
-------
-
Bug
#
1525866
:
Don
't copy directory stat times in
shutil.copytree on Windows
- Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
...
...
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