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
58d6b1b7
Kaydet (Commit)
58d6b1b7
authored
May 06, 2011
tarafından
Ronald Oussoren
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backport fix for issue #10684 from 3.x
üst
fe12aa67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
shutil.py
Lib/shutil.py
+6
-0
test_shutil.py
Lib/test/test_shutil.py
+18
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/shutil.py
Dosyayı görüntüle @
58d6b1b7
...
...
@@ -277,6 +277,12 @@ def move(src, dst):
"""
real_dst
=
dst
if
os
.
path
.
isdir
(
dst
):
if
_samefile
(
src
,
dst
):
# We might be on a case insensitive filesystem,
# perform the rename anyway.
os
.
rename
(
src
,
dst
)
return
real_dst
=
os
.
path
.
join
(
dst
,
_basename
(
src
))
if
os
.
path
.
exists
(
real_dst
):
raise
Error
,
"Destination path '
%
s' already exists"
%
real_dst
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
58d6b1b7
...
...
@@ -805,6 +805,24 @@ class TestCopyFile(unittest.TestCase):
self
.
assertTrue
(
srcfile
.
_exited_with
[
0
]
is
None
)
self
.
assertTrue
(
srcfile
.
_raised
)
def
test_move_dir_caseinsensitive
(
self
):
# Renames a folder to the same name
# but a different case.
self
.
src_dir
=
tempfile
.
mkdtemp
()
dst_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
self
.
src_dir
),
os
.
path
.
basename
(
self
.
src_dir
)
.
upper
())
self
.
assertNotEqual
(
self
.
src_dir
,
dst_dir
)
try
:
shutil
.
move
(
self
.
src_dir
,
dst_dir
)
self
.
assertTrue
(
os
.
path
.
isdir
(
dst_dir
))
finally
:
if
os
.
path
.
exists
(
dst_dir
):
os
.
rmdir
(
dst_dir
)
def
test_main
():
test_support
.
run_unittest
(
TestShutil
,
TestMove
,
TestCopyFile
)
...
...
Misc/NEWS
Dosyayı görüntüle @
58d6b1b7
...
...
@@ -77,6 +77,10 @@ Core and Builtins
Library
-------
- Issue #10684: shutil.move used to delete a folder on case insensitive
filesystems when the source and destination name where the same except
for the case.
- Issue #11982: fix json.loads('
""
') to return u'' rather than ''.
- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
...
...
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