Your message dated Sat, 06 Apr 2024 16:32:29 +0000
with message-id <e1rt8xx-0035fx...@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 ow...@bugs.debian.org
immediately.)


-- 
1066136: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066136
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
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(0, item_length - length + 
1):
-                            for size in six.moves.range(length, length + 1):
+                        for start in range(0, item_length - length + 1):
+                            for size in range(length, length + 1):
                                 end = start + size
                                 if end > item_length:
                                     continue

--- End Message ---
--- Begin Message ---
Source: python-xapian-haystack
Source-Version: 2.1.1-1+deb12u1
Done: Steinar H. Gunderson <se...@debian.org>

We believe that the bug you reported is fixed in the latest version of
python-xapian-haystack, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1066...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Steinar H. Gunderson <se...@debian.org> (supplier of updated 
python-xapian-haystack package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 19 Mar 2024 23:35:19 +0100
Source: python-xapian-haystack
Architecture: source
Version: 2.1.1-1+deb12u1
Distribution: bookworm
Urgency: medium
Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Changed-By: Steinar H. Gunderson <se...@debian.org>
Closes: 1066136
Changes:
 python-xapian-haystack (2.1.1-1+deb12u1) 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)
Checksums-Sha1:
 e96e4b72f2ca6ed02266619dcce8f549b96129a3 2197 
python-xapian-haystack_2.1.1-1+deb12u1.dsc
 37bd59e10c9e83517b759a403b5818e7d43c9058 3740 
python-xapian-haystack_2.1.1-1+deb12u1.debian.tar.xz
 dc2dec683917357e28a1701c6b06e5a95c40961d 6664 
python-xapian-haystack_2.1.1-1+deb12u1_amd64.buildinfo
Checksums-Sha256:
 814c0cb86426f7d4da2b7fc49a3404f5cd9092a0a17bd277d77de00e30f87c4a 2197 
python-xapian-haystack_2.1.1-1+deb12u1.dsc
 01dbf6feb8d12df44f958fd1a971f04b4b4495362a0ef22f112e71fcf7605e9e 3740 
python-xapian-haystack_2.1.1-1+deb12u1.debian.tar.xz
 bfe56a03cc7ad9f66bd009ac1ddb718e8c53dedec756476d580ae1eb8dcccf0d 6664 
python-xapian-haystack_2.1.1-1+deb12u1_amd64.buildinfo
Files:
 7bad41d9909a64a2e24a5b0510ac6e2e 2197 python optional 
python-xapian-haystack_2.1.1-1+deb12u1.dsc
 90948618c9a93b228d456725f6c2ff78 3740 python optional 
python-xapian-haystack_2.1.1-1+deb12u1.debian.tar.xz
 3e5c5237886f9aa570807540bd18e027 6664 python optional 
python-xapian-haystack_2.1.1-1+deb12u1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwukAT/AowY5OrduDf2F1YXeXj3YFAmYO6wgACgkQf2F1YXeX
j3ZliA//XlKIxaE8lC4dGrZY11tUa2jwuzlQvVXoQWJOTkOp7V40yzBVNfIpcTtF
yRW2ZDhU2B/S6Lvemk1v3/e8GOAIiK9jMQhU0Le3/e5wALU40g6W6QCu1goADYmc
xP1o6EOuA+2WVLboyYhLcy+YgTmUUBR4C2bO+X4toduQBTigK7FdNdTUZ3zjUJ6J
9XzwFgXKYMxHc34OcKBabIpS0NyOJpB4+K1t4WCfQiKQAxOfjyxw8HBt2MZRyei6
Vp3sduXzU+COaHffZVctogRiZhSkOyLFPQHIYZRPw2YgExT6me4TpJuRnlmaHvwD
J/fIRZUEfLj0hchBC+YU3lXV5x4m649Gh/CEbkLxg77BJUufooJTadEZnlA2+sRe
qwjRsBX9G/lJ81IEJJQwaiQkw5s38I2e+gAZFsXVOtnsUI6JhL6jrRD6O+j79817
uwD8PIj6sHWLrj6NqX3JQLDsYJd7LZbGCDHL/2kjmXjM0/TmC9D11vs3Yncj+8V3
4io6mgkK8/KpXygb8D8Jyves5nDOWyo47bQTdzpFmtw1K0nmS2JfRDQYJouB5ZHF
8v4WjF+zEFSFF34zN6508ufix9qYupYjSK65OCAOTY5XHDSzMBLZxcWcePLPCAzS
/A3hntOcpYYmiK4TKwHU21Cs8KwwGKQlySlk1VHUvQF+LmH6qG8=
=9rLz
-----END PGP SIGNATURE-----

Attachment: pgpYLD_Od4jr5.pgp
Description: PGP signature


--- End Message ---

Reply via email to