summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/debfile.py4
-rw-r--r--debian/changelog2
-rw-r--r--tests/test_debfile.py5
3 files changed, 7 insertions, 4 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index 33f0f04d..73f7d88e 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -512,7 +512,7 @@ class DebPackage(object):
return sorted(content)
@staticmethod
- def to_hex(self, in_data):
+ def to_hex(in_data):
hex = ""
for (i, c) in enumerate(in_data):
if i%80 == 0:
@@ -521,7 +521,7 @@ class DebPackage(object):
return hex
@staticmethod
- def to_strish(self, in_data):
+ def to_strish(in_data):
s = ""
for c in in_data:
if ord(c) < 10 or ord(c) > 127:
diff --git a/debian/changelog b/debian/changelog
index 9478bf89..7fd04b41 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,8 @@ python-apt (0.7.97) UNRELEASED; urgency=low
PartialPresent() from pkgAcquire(). This follows the change
in libapt.
* add "provides" property to the apt.Version objects
+ * apt/debfile.py:
+ - fix error when reading binary content and add regresion test
-- Julian Andres Klode <jak@debian.org> Fri, 23 Jul 2010 16:14:39 +0200
diff --git a/tests/test_debfile.py b/tests/test_debfile.py
index 72b9100c..42cda6f6 100644
--- a/tests/test_debfile.py
+++ b/tests/test_debfile.py
@@ -86,8 +86,9 @@ class TestDebfilee(unittest.TestCase):
# binary
deb = apt.debfile.DebPackage(cache=self.cache)
deb.open(os.path.join("data", "test_debs", "gdebi-test12.deb"))
- self.assertEqual('#!/bin/sh\necho "test"\n',
- deb.data_content("usr/bin/binary"))
+ content = deb.data_content("usr/bin/binary")
+ self.assertTrue(content.startswith("Automatically converted to printable ascii:\n\x7fELF "))
+
if __name__ == "__main__":
#logging.basicConfig(level=logging.DEBUG)