diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2007-04-20 20:10:59 +0000 |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2007-04-20 20:10:59 +0000 |
commit | 9319e43c675920fa69d1461bf9c6bb451647ae4d (patch) | |
tree | 497e0e1d16ebab23c70d2eb35a1989f67bfb0e7f /Lib/test/test_tarfile.py | |
parent | d220144a84b71d4d6a35d68b091a45780c5e5162 (diff) | |
download | cpython-git-9319e43c675920fa69d1461bf9c6bb451647ae4d.tar.gz |
Patch #1695229: Fix a regression with tarfile.open() and a missing name
argument.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index b1cbcf69c3..dc262f656d 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -633,15 +633,21 @@ class FileModeTest(unittest.TestCase): self.assertEqual(tarfile.filemode(07111), '---s--s--t') class OpenFileobjTest(BaseTest): - # Test for SF bug #1496501. def test_opener(self): + # Test for SF bug #1496501. fobj = StringIO.StringIO("foo\n") try: - tarfile.open("", "r", fileobj=fobj) + tarfile.open("", mode="r", fileobj=fobj) except tarfile.ReadError: self.assertEqual(fobj.tell(), 0, "fileobj's position has moved") + def test_fileobj(self): + # Test for SF bug #1695229, opening a tarfile without + # a name argument. + tarfile.open(mode="r", fileobj=open(tarname(""))) + tarfile.TarFile(mode="r", fileobj=open(tarname(""))) + if bz2: # Bzip2 TestCases class ReadTestBzip2(ReadTestGzip): |