Commit e199a494 authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 72295 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72295 | antoine.pitrou | 2009-05-04 23:17:17 +0200 (lun., 04 mai 2009) | 3 lines

  Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory.
........
parent 6da51a12
......@@ -940,7 +940,9 @@ class ZipFile:
"""
# build the destination pathname, replacing
# forward slashes to platform specific separators.
if targetpath[-1:] in (os.path.sep, os.path.altsep):
# Strip trailing path separator, unless it represents the root.
if (targetpath[-1:] in (os.path.sep, os.path.altsep)
and len(os.path.splitdrive(targetpath)[1]) > 1):
targetpath = targetpath[:-1]
# don't include leading "/" from file name if present
......
......@@ -36,6 +36,9 @@ Core and Builtins
Library
-------
- Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when
extracting a file to the root directory.
- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
- Issue #4305: ctypes should now build again on mipsel-linux-gnu
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment