• Bug#1066136: python3-xapian-haystack: unusable on stable due to use of

    From Ole Peder =?UTF-8?Q?Brandtz=C3=A6g?@21:1/5 to All on Wed Mar 13 00:10:01 2024
    This is a multi-part MIME message sent by reportbug.


    Package: python3-xapian-haystack
    Version: 2.1.1-1
    Severity: grave
    Tags: upstream patch
    Justification: renders package unusable

    Dear Maintainer,

    I installed python3-xapian-haystack in order to employ Xapian as a
    Haystack backend in mailman3-web on stable (bookworm).

    However, upon actually trying to use it, I got the following traceback:

    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
    File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/usr/lib/python3/dist-packages/hyperkitty/views/search.py", line 54, in search
    results = EmptySearchQuerySet()
    File "/usr/lib/python3/dist-packages/haystack/query.py", line 25, in __init__
    self._determine_backend()
    File "/usr/lib/python3/dist-packages/haystack/query.py", line 58, in _determine_backend
    self.query = connections[backend_alias].get_query()
    File "/usr/lib/python3/dist-packages/haystack/utils/loading.py", line 114, in __getitem__
    self.thread_local.connections[key] = load_backend(
    File "/usr/lib/python3/dist-packages/haystack/utils/loading.py", line 60, in load_backend
    return import_class(full_backend_path)
    File "/usr/lib/python3/dist-packages/haystack/utils/loading.py", line 22, in import_class
    module_itself = importlib.import_module(module_path)
    File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
    <source code not available>
    File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
    <source code not available>
    File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
    <source code not available>
    File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
    <source code not available>
    File "<frozen importlib._bootstrap_external>", line 940, in exec_module
    <source code not available>
    File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    <source code not available>
    File "/usr/lib/python3/dist-packages/xapian_backend.py", line 10, in <module>
    from django.utils import six

    Exception Type: ImportError at /hyperkitty/search
    Exception Value: cannot import name 'six' from 'django.utils' (/usr/lib/python3/dist-packages/django/utils/__init__.py)

    django.utils.six was removed in Django 3.0; the version of Django in
    stable is 3.2. Hence python3-xapian-haystack is currently unusable in
    stable, as it simply throws an ImportError upon loading.

    Upstream fixed this issue when they dropped Python 2 support in [0].
    However, I have a simpler patch that just removes the six import and
    changes all occurences of `six.moves.range()` to the built-in `range()`,
    which I've applied locally (hence the debsums complaint) and seems to do
    the trick.

    I would very much like a stable-update for this given that the package
    simply does not work without the patch.

    Many thanks,
    Ole

    [0]: https://github.com/notanumber/xapian-haystack/commit/0f9d94fb23ebf8cf194a3a88948a86f6dc69e786#diff-b4466d919fc4105c6306804abd396d6e0ba5e4630346928df34a5308c4700d97

    -- System Information:
    Debian Release: 12.5
    APT prefers stable-updates
    APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.7.8 (SMP w/16 CPU threads; PREEMPT)
    Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), LANGUAGE=en_NO:en_DK:en_US:en_GB:en
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)

    Versions of packages python3-xapian-haystack depends on:
    ii python3 3.11.2-1+b1
    ii python3-django-haystack 3.2.1-1
    ii python3-xapian 1.4.22-1

    python3-xapian-haystack recommends no packages.

    python3-xapian-haystack suggests no packages.

    -- no debconf information

    -- debsums errors found:
    debsums: changed file /usr/lib/python3/dist-packages/xapian_backend.py (from python3-xapian-haystack package)

    --- xapian_backend.py 2017-05-18 08:50:23.000000000 +0200
    +++ /usr/lib/python3/dist-packages/xapian_backend.py 2024-03-12 01:06:33.011301452 +0100
    @@ -7,7 +7,6 @@
    import shutil
    import sys

    -from django.utils import six
    from django.conf import settings
    from django.core.exceptions import ImproperlyConfigured
    from django.utils.encoding import force_text
    @@ -346,7 +345,7 @@
    def _get_ngram_lengths(value):
    values = value.split()
    for item in values:
    - for ngram_length in six.moves.range(NGRAM_MIN_LENGTH, NGRAM_MAX_LENGTH + 1):
    + for ngram_length in range(NGRAM_MIN_LENGTH, NGRAM_MAX_LENGTH + 1):
    yield item, ngram_length

    for obj in iterable:
    @@ -356,8 +355,8 @@
    def ngram_terms(value):
    for item, length in _get_ngram_lengths(value):
    item_length = len(item)
    - for start in six.moves.range
  • From Debian Bug Tracking System@21:1/5 to All on Wed Mar 20 00:00:01 2024
    Processing control commands:

    tags 1066136 + pending
    Bug #1066136 [python3-xapian-haystack] python3-xapian-haystack: unusable on stable due to use of deprecated module django.utils.six
    Added tag(s) pending.

    --
    1066136: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066136
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steinar H. Gunderson@21:1/5 to All on Wed Mar 20 00:00:01 2024
    Control: tags 1066136 + pending

    Hi,

    I've prepared an NMU for python-xapian-haystack (versioned as 2.1.1-1+deb12u0.1) and uploaded it to DELAYED/14-day. (The unusually
    long delay is since this is a stable upload.)

    NMU diff is attached.

    /* Steinar */
    --
    Homepage: https://www.sesse.net/

    diff -Nru python-xapian-haystack-2.1.1/debian/changelog python-xapian-haystack-2.1.1/debian/changelog
    --- python-xapian-haystack-2.1.1/debian/changelog 2021-10-19 22:10:20.000000000 +0200
    +++ python-xapian-haystack-2.1.1/debian/changelog 2024-03-19 23:35:19.000000000 +0100
    @@ -1,3 +1,12 @@
    +python-xapian-haystack (2.1.1-1+deb12u0.1) bookworm; urgency=medium
    +
    + * Non-maintainer upload, to stable.
    + * Remove dependency on the django.utils.six module, which no longer exists, + causing the package to be completely broken. Patch by Ole Peder Brandtzæg,
    + based on reducing a patch from upstream. (Closes: #1066136)
    +
    + -- Steinar H. Gunderson <sesse@debian.org> Tue, 19 Mar 2024 23:35:19 +0100
    +
    python-xapian-haystack (2.1.1-1) unstable; urgency=low

    [ Debian Janitor ]
    diff -Nru python-xapian-haystack-2.1.1/debian/patches/0002-Remove-dependency-on-six.patch python-xapian-haystack-2.1.1/debian/patches/0002-Remove-dependency-on-six.patch
    --- python-xapian-haystack-2.1.1/debian/patches/0002-Remove-dependency-on-six.patch 1970-01-01 01:00:00.000000000 +0100
    +++ python-xapian-haystack-2.1.1
  • From Debian Bug Tracking System@21:1/5 to All on Sat Apr 6 18:40:02 2024
    This is a multi-part message in MIME format...

    Your message dated Sat, 06 Apr 2024 16:32:29 +0000
    with message-id <E1rt8xx-0035Fx-SA@fasolo.debian.org>
    and subject line Bug#1066136: fixed in python-xapian-haystack 2.1.1-1+deb12u1 has caused the Debian Bug report #1066136,
    regarding python3-xapian-haystack: unusable on stable due to use of deprecated module django.utils.six
    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 owner@bugs.debian.org
    immediately.)


    --
    1066136: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066136
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 12 Mar 2024 22:58:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-16.9 required=4.0 tests=BAYES_00,
    BODY_INCLUDES_PACKAGE,FOURLA,HAS_PACKAGE,MD5_SHA1_SUM,SPF_HELO_PASS,
    SPF_PASS,T_SCC_BODY_TEXT_LINE,XMAILER_REPORTBUG autolearn=ham
    autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 62; hammy, 150; neutral, 252; spammy,
    0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--bookworm,
    0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug, 0.000-+--H*x:12.0.0 Return-path: <olebra@samfundet.no>
    Received: from cassarossa.samfundet.no ([2001:67c:29f4::29]:44015)
    by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)