Fixing line length in a while condition and fixing the BPO func to meth

This commit is contained in:
Matan Perelman 2020-11-01 20:22:28 +02:00
parent 30b5e4d702
commit bf370eecca
2 changed files with 3 additions and 2 deletions

View File

@ -510,7 +510,8 @@ class ZipInfo (object):
if arcname is None:
arcname = filename
arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
while arcname[0] in (os.sep, os.altsep) and arcname[1] in (os.sep, os.altsep):
while (arcname[0] in (os.sep, os.altsep) and
arcname[1] in (os.sep, os.altsep)):
arcname = arcname[1:]
if arcname[0] in (os.sep, os.altsep) and os.sep not in arcname[1:]:
arcname = arcname[1:]

View File

@ -1,2 +1,2 @@
Fix unnecessary removing of a leading slash in :func:`zipfile.ZipInfo.from_file`
Fix unnecessary removing of a leading slash in :meth:`zipfile.ZipInfo.from_file`
when member's archive name is in the form of `/directory/filename`.