summaryrefslogtreecommitdiff
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-11 10:32:41 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-11 10:32:41 +0200
commit6a45021084f287cf389205939784d32f29efb20c (patch)
tree5ae62310475dd8f07c68f716bdd452b7fee6a8c8 /Lib/shutil.py
parent42ec031fe75601710b4edbfe7e617b97b4948de6 (diff)
parent3a308b9f374da7f11df888f104dae6464e81d73d (diff)
downloadcpython-git-6a45021084f287cf389205939784d32f29efb20c.tar.gz
Issue #19856: shutil.move() failed to move a directory to other directory
on Windows if source name ends with os.altsep.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 9a6a0406bd..0cd6ec48e1 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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