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
6a450210
Kaydet (Commit)
6a450210
authored
Şub 11, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #19856: shutil.move() failed to move a directory to other directory
on Windows if source name ends with os.altsep.
üst
42ec031f
3a308b9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
shutil.py
Lib/shutil.py
+2
-1
test_shutil.py
Lib/test/test_shutil.py
+9
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/shutil.py
Dosyayı görüntüle @
6a450210
...
...
@@ -483,7 +483,8 @@ rmtree.avoids_symlink_attacks = _use_fd_functions
def
_basename
(
path
):
# A basename() variant which first strips the trailing slash, if present.
# Thus we always get the last component of the path, even for directories.
return
os
.
path
.
basename
(
path
.
rstrip
(
os
.
path
.
sep
))
sep
=
os
.
path
.
sep
+
(
os
.
path
.
altsep
or
''
)
return
os
.
path
.
basename
(
path
.
rstrip
(
sep
))
def
move
(
src
,
dst
):
"""Recursively move a file or directory to another location. This is
...
...
Lib/test/test_shutil.py
Dosyayı görüntüle @
6a450210
...
...
@@ -1492,6 +1492,15 @@ class TestMove(unittest.TestCase):
# Move a dir inside an existing dir on another filesystem.
self
.
test_move_dir_to_dir
()
def
test_move_dir_sep_to_dir
(
self
):
self
.
_check_move_dir
(
self
.
src_dir
+
os
.
path
.
sep
,
self
.
dst_dir
,
os
.
path
.
join
(
self
.
dst_dir
,
os
.
path
.
basename
(
self
.
src_dir
)))
@unittest.skipUnless
(
os
.
path
.
altsep
,
'requires os.path.altsep'
)
def
test_move_dir_altsep_to_dir
(
self
):
self
.
_check_move_dir
(
self
.
src_dir
+
os
.
path
.
altsep
,
self
.
dst_dir
,
os
.
path
.
join
(
self
.
dst_dir
,
os
.
path
.
basename
(
self
.
src_dir
)))
def
test_existing_file_inside_dest_dir
(
self
):
# A file with the same name inside the destination dir already exists.
with
open
(
self
.
dst_file
,
"wb"
):
...
...
Misc/NEWS
Dosyayı görüntüle @
6a450210
...
...
@@ -37,6 +37,9 @@ Core and Builtins
Library
-------
- Issue #19856: shutil.move() failed to move a directory to other directory
on Windows if source name ends with os.altsep.
- Issue #20530: The signatures for slot builtins have been updated
to reflect the fact that they only accept positional-only arguments.
...
...
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