Web lists-archives.com

Call for tests: New python-magic Python bindings for libmagic




# TL;DR

* The python-magic Python library for file type detection will switch
  to a different implementation soon.

* Code that relies on the old implementation should not be harmed,
  everything else is a bug.

* Such code however might need an adjustment some distant day, not
  before the buster release though.

* This is your chance to make this change as smooth as possible.


Hello,

for many years, there have been two Python bindings for the libmagic
file type detection library, both using the name "python-magic", but
with different and incompatible APIs. At the moment, Debian ships the
implementation bundled with src:file [file], maintained by Christos
Zoulas. However, there are several packages where upstream decided to
use the [pypi] implementation by Adam Hupp, Debian maintainers included
a code copy then.

Anyway, this awkward situation will come to an end: Kudos to Adam who
implemented a [file] compatibility layer in [pypi]. There is already a
python-magic package in experimental that provides both APIs, and the
created binary packages are to replace the one created by src:file.

Initial checks showed no regressions so far, but before doing the
switch by uploading to unstable I'd like to have a broader coverage,
therefore this

                      Call for tests

of all the packages that depend on python-magic and/or python3-magic,
also of other applications that use the [file] implementation. The
output of dd-list on the rdeps is attached below.


# How to test

Install python-magic and/or python3-magic from experimental and re-run
your applications. Is there code breakage? Or a file type detection
change?

Maintainers for packages that use a code copy of [pypi] might give it
a try as well, although nothing should go wrong then.


# Reporting bugs

The usual recommendations about filing bug reports apply.

At first, double-check whether your observation really was introduced
by the python-magic change, i.e. downgrade to the [file] version and
check somewhere else if the problem persists.

If it's obviously upstream, you'll do me a favor if you send the
reports to the upstream bug tracker[1], mention it's about the
"libmagic-compat" feature, and just leave a pointer in Debian's BTS.
Else or in case of doubt, report to the BTS and I'll do the triaging
and forwarding.


# Outlook

Two weeks from now the [pypi] implementation of python-magic is to hit
unstable, later testing according to the usual migration rules.

After that, packages that ship a [pypi] code copy will see a whishlist
bug to drop this as it's no longer needed (some three packages,
therefore no MBF).

For the buster release (somewhen 2019), I'll go to great lengths to
make sure python-magic ships the compatibility layer. In other words,
there is no need to change implementations based on [file] for the time
being.

Beyond buster: Depending on upstream development, the [file] API might
go away some day. As mentioned above, in Debian this will not happen
before the buster release. The [pypi] implementation will emit
deprecation warnings beforehand then (code is already there but
disabled). Otherwise it's too early for detailed plans.

Cheers,

    Christoph

[file] https://www.darwinsys.com/file/
       Current version in Debian sid: 1:5.32-1
[pypi] https://github.com/ahupp/python-magic/
       Current version in Debian experimenta: 2:0.4.15-1~exp2
[1] https://github.com/ahupp/python-magic/issues



Andrea Capriotti <capriott@xxxxxxxxxx>
   autoradio

Arturo Borrero Gonzalez <arturo@xxxxxxxxxx>
   rpmlint (U)

Chris Lamb <lamby@xxxxxxxxxx>
   diffoscope (U)

David Paleino <dapal@xxxxxxxxxx>
   syslog-summary

Debian Astronomy Team <debian-astro-maintainers@xxxxxxxxxxxxxxxxxxxxxxx>
   ginga

Debian LAVA team <pkg-linaro-lava-devel@xxxxxxxxxxxxxxxxxxxxxxx>
   lava-dispatcher

Debian Tryton Maintainers <tryton-debian@xxxxxxxxxxxxxxxxxxxxxxx>
   relatorio

Devscripts Devel Team <devscripts-devel@xxxxxxxxxxxxxxxxxxxxxxx>
   devscripts

Gaetano Guerriero <x.guerriero@xxxxxx>
   eyed3

Gianfranco Costamagna <locutusofborg@xxxxxxxxxx>
   s3cmd (U)

Holger Levsen <holger@xxxxxxxxxx>
   diffoscope (U)

Hugo Lefeuvre <hle@xxxxxxxxxx>
   alot (U)

Jordan Justen <jordan.l.justen@xxxxxxxxx>
   alot (U)

Kouhei Maeda <mkouhei@xxxxxxxxxx>
   swiftsc

Mathias Behrle <mathiasb@xxxxxxx>
   relatorio (U)

Matt Domsch <matt@xxxxxxxxxx>
   s3cmd

Mattia Rizzolo <mattia@xxxxxxxxxx>
   devscripts (U)
   diffoscope (U)

Neil Williams <codehelp@xxxxxxxxxx>
   lava-dispatcher (U)

Ole Streicher <olebole@xxxxxxxxxx>
   ginga (U)

Paul Wise <pabs@xxxxxxxxxx>
   check-all-the-things

Paulo Roberto Alves de Oliveira (aka kretcheu) <kretcheu@xxxxxxxxx>
   rows

Python Applications Packaging Team <python-apps-team@xxxxxxxxxxxxxxxxxxxxxxx>
   alot

Reiner Herrmann <reiner@xxxxxxxxxxx>
   diffoscope (U)

Reproducible builds folks <reproducible-builds@xxxxxxxxxxxxxxxxxxxxxxx>
   diffoscope

Ritesh Raj Sarraf <rrs@xxxxxxxxxx>
   apt-offline

RPM packaging team <pkg-rpm-devel@xxxxxxxxxxxxxxxxxxxxxxx>
   rpmlint

Senthil Kumaran S (stylesen) <stylesen@xxxxxxxxx>
   lava-dispatcher (U)

Simon Chopin <chopin.simon@xxxxxxxxx>
   alot (U)

Ximin Luo <infinity0@xxxxxxxxxx>
   diffoscope (U)

Attachment: signature.asc
Description: Digital signature