[python-debian/master] debian_support: allow for tabs/spaces in stanza separators

Stefano Zacchiroli zack at upsilon.cc
Tue Apr 7 08:54:57 UTC 2009


Note: this behaviour is not ruled in policy yet, see #501930, but it
is coherent with what deb822 does, which is our legacy Packages file
parser now.

(Closes: #501927)
---
 debian/changelog                |    2 ++
 debian_bundle/debian_support.py |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4910ff9..21d4d08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ python-debian (0.1.13) unstable; urgency=low
   * Switch from "sha" module to "hashlib": fix a deprecation warning of
     Python 2.6. As a consequence, update pyversions to require a minimum
     of Python 2.5, which is available also in stable now. (Closes: #518427)
+  * debian_support.PackageFile: allow for stanza separators made of tabs
+    and spaces in addition to newlines (Closes: #501927)
 
  -- Stefano Zacchiroli <zack at debian.org>  Tue, 07 Apr 2009 10:21:04 +0200
 
diff --git a/debian_bundle/debian_support.py b/debian_bundle/debian_support.py
index 1e1a668..4561a4b 100644
--- a/debian_bundle/debian_support.py
+++ b/debian_bundle/debian_support.py
@@ -110,7 +110,7 @@ class PackageFile:
         self.lineno += 1
         pkg = []
         while line:
-            if line == '\n':
+            if line.strip(' \t') == '\n':
                 if len(pkg) == 0:
                     self.raise_syntax_error('expected package record')
                 yield pkg
-- 
1.5.6.5




More information about the pkg-python-debian-commits mailing list