diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-29 20:30:51 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-29 20:30:51 (GMT) |
commit | 4ad77e25502b8a9547b3590465bd842a4fb068fb (patch) | |
tree | cbdb2306202352d644641f332f4eef19ca3511fd /Lib/shutil.py | |
parent | fa7e69dc51943a677737e8fc414d2ec196011647 (diff) | |
download | cpython-4ad77e25502b8a9547b3590465bd842a4fb068fb.zip cpython-4ad77e25502b8a9547b3590465bd842a4fb068fb.tar.gz cpython-4ad77e25502b8a9547b3590465bd842a4fb068fb.tar.bz2 |
Merged revisions 69100 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69100 | antoine.pitrou | 2009-01-29 21:19:34 +0100 (jeu., 29 janv. 2009) | 5 lines
Issue #2047: shutil.move() could believe that its destination path was
inside its source path if it began with the same letters (e.g. "src" vs.
"src.new").
........
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index ae2c66c..cfb6646 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -265,4 +265,10 @@ def move(src, dst): os.unlink(src) def destinsrc(src, dst): - return abspath(dst).startswith(abspath(src)) + src = abspath(src) + dst = abspath(dst) + if not src.endswith(os.path.sep): + src += os.path.sep + if not dst.endswith(os.path.sep): + dst += os.path.sep + return dst.startswith(src) |