mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Fix directory names to have only one trailing slash.
A regression from rev. 52525.
This commit is contained in:
parent
9701832161
commit
d220144a84
3 changed files with 19 additions and 1 deletions
|
@ -1842,7 +1842,7 @@ class TarFile(object):
|
||||||
tarinfo.type = DIRTYPE
|
tarinfo.type = DIRTYPE
|
||||||
|
|
||||||
# Directory names should have a '/' at the end.
|
# Directory names should have a '/' at the end.
|
||||||
if tarinfo.isdir():
|
if tarinfo.isdir() and not tarinfo.name.endswith("/"):
|
||||||
tarinfo.name += "/"
|
tarinfo.name += "/"
|
||||||
|
|
||||||
self.members.append(tarinfo)
|
self.members.append(tarinfo)
|
||||||
|
|
|
@ -191,6 +191,13 @@ class ReadTest(BaseTest):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def test_dirtype(self):
|
||||||
|
for tarinfo in self.tar:
|
||||||
|
if tarinfo.isdir():
|
||||||
|
self.assert_(tarinfo.name.endswith("/"))
|
||||||
|
self.assert_(not tarinfo.name[:-1].endswith("/"))
|
||||||
|
|
||||||
|
|
||||||
class ReadStreamTest(ReadTest):
|
class ReadStreamTest(ReadTest):
|
||||||
sep = "|"
|
sep = "|"
|
||||||
|
|
||||||
|
|
11
Misc/NEWS
11
Misc/NEWS
|
@ -4,6 +4,17 @@ Python News
|
||||||
|
|
||||||
(editors: check NEWS.help for information about editing NEWS using ReST.)
|
(editors: check NEWS.help for information about editing NEWS using ReST.)
|
||||||
|
|
||||||
|
What's New in Python 2.5.2c1?
|
||||||
|
=============================
|
||||||
|
|
||||||
|
*Release date: XX-XXX-XXXX*
|
||||||
|
|
||||||
|
Library
|
||||||
|
-------
|
||||||
|
|
||||||
|
- tarfile.py: Fix directory names to have only one trailing slash.
|
||||||
|
|
||||||
|
|
||||||
What's New in Python 2.5.1?
|
What's New in Python 2.5.1?
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue