Bug#1109660: unblock: afew/3.0.1-8
Package: release.debian.org
Severity: normal
X-Debbugs-Cc: afew@packages.debian.org
Control: affects -1 + src:afew
User: release.debian.org@packages.debian.org
Usertags: unblock
[ Reason ]
Fix important bug https://bugs.debian.org/1106896: afew is unable to
remove tags.
[ Impact ]
afew raises KeyError when it tries to remove tags, as shown for example
in https://github.com/afewmail/afew/pull/320#issuecomment-2782420815.
[ Tests ]
None, as far as I know.
[ Risks ]
The patch updates to the latest version of an upstream PR; aside from
some irrelevant-to-us GitHub workflow changes, this just adds an "except
KeyError: pass" handler, and it seems clear enough that removing a tag
that already doesn't exist is a situation that can be ignored. So this
seems safe enough to me.
[ Checklist ]
[x] all changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in testing
unblock afew/3.0.1-8
Thanks,
--
Colin Watson (he/him) [cjwatson@debian.org]
diff -Nru afew-3.0.1/debian/changelog afew-3.0.1/debian/changelog
--- afew-3.0.1/debian/changelog 2025-03-15 20:35:00.000000000 +0000
+++ afew-3.0.1/debian/changelog 2025-07-03 14:02:50.000000000 +0100
@@ -1,3 +1,12 @@
+afew (3.0.1-8) unstable; urgency=medium
+
+ * Team upload.
+
+ [ itd ]
+ * BaseFilter: allow removing non-existent tags (closes: #1106896).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 03 Jul 2025 14:02:50 +0100
+
afew (3.0.1-7) unstable; urgency=medium
* Team upload.
diff -Nru afew-3.0.1/debian/patches/apply-upstream-pull-request-320.patch afew-3.0.1/debian/patches/apply-upstream-pull-request-320.patch
--- afew-3.0.1/debian/patches/apply-upstream-pull-request-320.patch 2025-03-15 20:35:00.000000000 +0000
+++ afew-3.0.1/debian/patches/apply-upstream-pull-request-320.patch 2025-07-03 13:59:50.000000000 +0100
@@ -4,11 +4,11 @@
This is labelled draft upstream, but seems to be tested by mjg.
---
- .github/workflows/build.yml | 6 ++---
+ .github/workflows/build.yml | 4 +--
afew/Database.py | 31 ++++++++++------------
afew/MailMover.py | 8 +++---
afew/files.py | 10 +++----
- afew/filters/BaseFilter.py | 20 +++++++-------
+ afew/filters/BaseFilter.py | 23 +++++++++-------
afew/filters/DKIMValidityFilter.py | 10 ++++---
afew/filters/DMARCReportInspectionFilter.py | 4 +--
afew/filters/FolderNameFilter.py | 10 ++++---
@@ -24,30 +24,21 @@
afew/utils.py | 12 ++++++---
docs/extending.rst | 2 +-
setup.py | 2 +-
- 20 files changed, 103 insertions(+), 88 deletions(-)
+ 20 files changed, 105 insertions(+), 87 deletions(-)
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
-@@ -9,7 +9,7 @@
- matrix:
- python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
- name: Build (Python ${{ matrix.python-version }})
-- runs-on: ubuntu-20.04
-+ runs-on: ubuntu-21.04
- steps:
- - uses: actions/checkout@v2
- with:
@@ -24,11 +24,11 @@
shell: bash
run: |
sudo apt-get update
- sudo apt-get install -y notmuch python3-notmuch python3-venv flake8
-+ sudo apt-get install -y notmuch python3-notmuch2 python3-venv flake8
++ sudo apt-get install -y notmuch libnotmuch-dev python3-venv flake8
python3 -m venv env
source ./env/bin/activate
pip install setuptools setuptools_scm pytest dkimpy
- ln -s /usr/lib/python3/dist-packages/notmuch ./env/lib/python*/site-packages
-+ ln -s /usr/lib/python3/dist-packages/notmuch2 ./env/lib/python*/site-packages
++ pip install notmuch2
- name: flake8 lint
run: |
source ./env/bin/activate
@@ -245,7 +236,7 @@
def commit(self, dry_run=True):
dirty_messages = set()
-@@ -93,15 +93,15 @@
+@@ -93,15 +93,18 @@
db = self.database.open(rw=True)
for message_id in dirty_messages:
@@ -261,7 +252,10 @@
for tag in self._remove_tags.get(message_id, []):
- message.remove_tag(tag)
-+ message.tags.remove(tag)
++ try:
++ message.tags.remove(tag)
++ except KeyError:
++ pass
self.flush_changes()
--- a/afew/filters/DKIMValidityFilter.py
Reply to: