[Python-checkins] r72296 - in python/branches/py3k: Lib/zipfile.py Misc/NEWS

antoine.pitrou python-checkins at python.org
Mon May 4 23:21:36 CEST 2009


Author: antoine.pitrou
Date: Mon May 4 23:21:36 2009
New Revision: 72296
Log:
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.
........
Modified:
 python/branches/py3k/ (props changed)
 python/branches/py3k/Lib/zipfile.py
 python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Lib/zipfile.py
==============================================================================
--- python/branches/py3k/Lib/zipfile.py	(original)
+++ python/branches/py3k/Lib/zipfile.py	Mon May 4 23:21:36 2009
@@ -959,7 +959,9 @@
 """
 # 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
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon May 4 23:21:36 2009
@@ -112,6 +112,9 @@
 Library
 -------
 
+- Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when
+ extracting a file to the root directory.
+
 - Issue #5913: os.listdir() should fail for empty path on windows.
 
 - Issue #5084: unpickling now interns the attribute names of pickled objects,


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /