Hi Laurent,

On Sat, Oct 24, 2009 at 07:39:21AM +0200, Laurent Bonnaud wrote:
> Package: python-debian
> Version: 0.1.14
> Severity: normal
> 
> 
> Hi,
> 
> here is the problem:
> 
> # update-apt-xapian-index --quiet
> /usr/lib/pymodules/python2.5/debian_bundle/deb822.py:244:
> DeprecationWarning: apt_pkg.ParseTagFile() is deprecated. Please see
> apt_pkg.TagFile() for the replacement.
>   parser = apt_pkg.ParseTagFile(sequence)
> 
> This is annoying because every week, /etc/cron.weekly/apt-xapian-index
> outputs this warning and an e-mail is sent to the admin.
> 
> 
> -- System Information:
> Debian Release: squeeze/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (1, 'experimental')
> Architecture: i386 (i686)
> 
> Kernel: Linux 2.6.31-trunk-686-bigmem (SMP w/2 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
> 
> Versions of packages python-debian depends on:
> ii  python                        2.5.4-3    An interactive high-level 
> object-o
> ii  python-support                1.0.4      automated rebuilding support for 
> P
> 
> Versions of packages python-debian recommends:
> ii  python-apt                    0.7.92     Python interface to libapt-pkg
> 
> Versions of packages python-debian suggests:
> ii  gpgv                          1.4.10-2   GNU privacy guard - signature 
> veri

Unfortunately, the apt_pkg.TagFile interface is not available in the
version of python-apt in unstable.  I'll see if the interface is similar
enough to the old ParseTagFile one to make deb822 use it if it's
available but fall back on the old one if not.  If it would mean a bunch
of extra code, I'd prefer to wait until this shows up in unstable.

Meanwhile, you can patch deb822.py like this:

diff --git a/debian_bundle/deb822.py b/debian_bundle/deb822.py
index dd1d201..371fe9b 100644
--- a/debian_bundle/deb822.py
+++ b/debian_bundle/deb822.py
@@ -27,6 +27,9 @@ from deprecation import function_deprecated_by
 try:
     import apt_pkg
     _have_apt_pkg = True
+    import warnings
+    warnings.filterwarnings("ignore", category=DeprecationWarning,
+                            message=r"apt_pkg.ParseTagFile\(\) is deprecated")
 except ImportError:
     _have_apt_pkg = False
 

I'll consider committing a patch like this, but I don't really like to
ignore warnings in released code...

-- 
John Wright <j...@debian.org>



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to