diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-11-06 22:05:59 +0100 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-11-07 07:58:44 +0100 |
commit | 570564c21558620f474666ab3dc18e10c0818c40 (patch) | |
tree | d9ae507adcd2adc5a2d79c57027f993a345ac80e | |
parent | d92026e96db4a4d03cec9f135b5407804892c55f (diff) | |
download | python-apt-570564c21558620f474666ab3dc18e10c0818c40.tar.gz |
apt/debfile.py: use apt_pkg.open_maybe_clear_signed_file() when opening a .dsc file
-rw-r--r-- | apt/debfile.py | 3 | ||||
-rw-r--r-- | tests/test_tagfile.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index 1f93b7bb..20cf563c 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -714,7 +714,8 @@ class DscSrcPackage(DebPackage): """Open the package.""" depends_tags = ["Build-Depends", "Build-Depends-Indep"] conflicts_tags = ["Build-Conflicts", "Build-Conflicts-Indep"] - fobj = open(file) + fd = apt_pkg.open_maybe_clear_signed_file(file) + fobj = os.fdopen(fd) tagfile = apt_pkg.TagFile(fobj) try: for sec in tagfile: diff --git a/tests/test_tagfile.py b/tests/test_tagfile.py index 986ddfbc..1ac20624 100644 --- a/tests/test_tagfile.py +++ b/tests/test_tagfile.py @@ -35,7 +35,7 @@ class TestOpenMaybeClearSigned(unittest.TestCase): fd = apt_pkg.open_maybe_clear_signed_file( os.path.join(basepath, "./data/test_debs/hello_2.5-1.dsc")) f = os.fdopen(fd) - data = f.read().encode("utf-8") + data = f.read() self.assertTrue(data.startswith("Format: 1.0\n")) def test_open_normal(self): @@ -43,7 +43,7 @@ class TestOpenMaybeClearSigned(unittest.TestCase): fd = apt_pkg.open_maybe_clear_signed_file( os.path.join(basepath, "./data/misc/foo_Release")) f = os.fdopen(fd) - data = f.read().encode("utf-8") + data = f.read() self.assertTrue(data.startswith("Origin: Ubuntu\n")) def xtest_open_does_not_exit(self): |