Your message dated Sun, 10 Sep 2017 01:47:22 +1000
with message-id <5982738.tpppC8ArOs@jatayu>
and subject line Re: python-debian: required dependency on python-apt
has caused the Debian Bug report #862058,
regarding python-debian: required dependency on python-apt
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
862058: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862058
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-debian
Version: 0.1.28
Severity: normal

Dear Maintainer,

python-debian has a Recommends: dependency on python-apt, and a
mechanism to import alternatives when it is not present.

However, when using Sources.iter_paragraphs(f), with f being a file
object of a compressed file (e.g. Sources.gz), python-debian will
decompress the file when python-apt is present, and try to read the
compressed file when it is not (and fail with an expected
UnicodeDecode error).

This affects all current versions.

Cheers,
--
Matthieu

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-debian depends on:
ii  python-chardet  2.3.0-2
ii  python-six      1.10.0-3
pn  python:any      <none>

Versions of packages python-debian recommends:
ii  python-apt  1.1.0~beta4

Versions of packages python-debian suggests:
ii  gpgv  1.4.20-6

-- no debconf information

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Hi Matthieu,

Thanks for your message. You are quite correct in your analysis but I disagree 
that this is unreasonable behaviour. 

> python-debian has a Recommends: dependency on python-apt, and a
> mechanism to import alternatives when it is not present.
> 
> However, when using Sources.iter_paragraphs(f), with f being a file
> object of a compressed file (e.g. Sources.gz), python-debian will
> decompress the file when python-apt is present, and try to read the
> compressed file when it is not (and fail with an expected
> UnicodeDecode error).

That iter_paragraphs works with compressed indexes at all is somewhat 
accidental. I don't believe it is documented anywhere that this is a supported 
use of iter_paragraphs. (But it's rather handy that it does work!) In fact, 
the documentation says that iter_paragraphs accepts:

 sequence: a string, or any any object that returns a line of
            input each time, normally a file.

(not a compressed file).

Further, my feeling is that if a user chooses to break a Recommends, they get 
what is coming to them and policy is quite clear about that. 

If some other package is using python-debian in such a way that it is feeding 
Sources.gz into python-debian and relying on the presence of python-apt, then 
that tool must take responsibility for what it is doing and should depend on 
python-apt to ensure that the functionality to deal with compressed indexes is 
available. I dislike libraries using Recommends and I would actually be more 
likely to resolve this situation by changing the Recommends to a Suggests in 
order to be even more clear that this is the responsibility of the calling 
code.

As a user of the iter_paragraphs (and other!) functions, if you are in a 
position to add to the docstrings of these functions so that this contract is 
more clear to programmer, then that would be greatly appreciated. Building 
some API docs with sphinx is something we should aim for but at present, there 
is not nearly enough documentation to make that worthwhile.

regards
Stuart


-- 
Stuart Prescott    http://www.nanonanonano.net/   [email protected]
Debian Developer   http://www.debian.org/         [email protected]
GPG fingerprint    90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7

--- End Message ---
-- 
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-python-debian-maint

Reply via email to