From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KIaqFWMFVWTk1gAASxT56A (envelope-from ) for ; Fri, 05 May 2023 15:32:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iNjtFWMFVWT3ZwEA9RJhRA (envelope-from ) for ; Fri, 05 May 2023 15:32:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 062F23E3F5 for ; Fri, 5 May 2023 15:32:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puvXf-0003CC-Md; Fri, 05 May 2023 09:32:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puvXW-000395-JS for bug-guix@gnu.org; Fri, 05 May 2023 09:32:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puvXW-000377-Aw for bug-guix@gnu.org; Fri, 05 May 2023 09:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puvXW-0005Yi-6X for bug-guix@gnu.org; Fri, 05 May 2023 09:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63205: quodlibet fails to build after python 3.10 update References: <4d65908d-97c3-4f57-bc51-da8f58e43f1c@app.fastmail.com> In-Reply-To: <4d65908d-97c3-4f57-bc51-da8f58e43f1c@app.fastmail.com> Resent-From: Alice BRENON Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 May 2023 13:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63205 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63205@debbugs.gnu.org Received: via spool by 63205-submit@debbugs.gnu.org id=B63205.168329350721341 (code B ref 63205); Fri, 05 May 2023 13:32:02 +0000 Received: (at 63205) by debbugs.gnu.org; 5 May 2023 13:31:47 +0000 Received: from localhost ([127.0.0.1]:53424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puvXH-0005Y8-86 for submit@debbugs.gnu.org; Fri, 05 May 2023 09:31:47 -0400 Received: from lxc-smtp2.ens-lyon.fr ([140.77.167.81]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puvXF-0005Xv-5G for 63205@debbugs.gnu.org; Fri, 05 May 2023 09:31:45 -0400 Received: from localhost (localhost [127.0.0.1]) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTP id 9ECE6E3965 for <63205@debbugs.gnu.org>; Fri, 5 May 2023 15:31:43 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at ens-lyon.fr Received: from lxc-smtp2.ens-lyon.fr ([127.0.0.1]) by localhost (lxc-smtp2.ens-lyon.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BNkarWj5fQw8 for <63205@debbugs.gnu.org>; Fri, 5 May 2023 15:31:43 +0200 (CEST) Received: from localhost (unknown [78.194.167.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by lxc-smtp2.ens-lyon.fr (Postfix) with ESMTPSA id 8574AE2061 for <63205@debbugs.gnu.org>; Fri, 5 May 2023 15:31:43 +0200 (CEST) Date: Fri, 5 May 2023 15:31:42 +0200 From: Alice BRENON Message-ID: <20230505153142.27a1263f@ens-lyon.fr> Organization: ENS de Lyon X-Mailer: Claws Mail 4.1.1 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/7fctDqT/2Ev3Gtdqu3sm6yH" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683293539; a=rsa-sha256; cv=none; b=Pk+1HCQxA3HxleUiqd2WOiiJowog+HTHjkFDNk9fWey+firz+a1+RU3xLn+TLkgL28hphI KCSXe1ybwdYwZblNjGjkGF0UXvm/ilMlD4CrD3M1/fRq8ezyUkikNtwyMe7JrhM7UvG+hR t/91TYWHm2FiVrqksbmz2FCQULU+HbdHEqQNGZUkjuKLZ/zQGgrx2s42U7+Mepqikimls8 GOZVgKMRHl8NXAFRitcG7K1XBvT1iCJNRPHj0nUXkyL5BKTeS8L5piAyIRfHueAtcKGzjz 5A4PP9LPKpGmbCSxYCS0WIWcmPT4rpzmEIElmQBhktPebK2sZVMBz29o6jAiSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683293539; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=p4zIhdhS8xAEy3mMtbkC+vEs+se+AMMDx0qPQMnYeck=; b=bzazbkVqembJ5pwxF2cs7CQzh6r1S4tLZe+D95n5QcSD+DJ3dO/qPHK+kU40+MQuicXq7K rhO/puVcTS+7BNCNkSY2heE4X9mKTYu5k7VhFSdCdkvP1jy5Yhw3SQgCshJ/YfY9GoeaPD k+5tIS4QQ0e8O2E0iA3GSDz8tMqZpca6xqdmcDn23j+io5jVYM8JomLgOBoOqODr0apG+2 cVhCKaIG2kT4yNKQVZcOOhT9G0AaeP8Ph5Idsb+Edkq37+keoTp8xpfHEeR30u90t63+xs G0F6QpMMAV8kwpSnSWpM3CJhkjH/K5BE6jkkO/4PafoBi3fb19rxjUV7cf9rNw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.70 X-Spam-Score: -1.70 X-Migadu-Queue-Id: 062F23E3F5 X-TUID: XPxouv8FAO0r --MP_/7fctDqT/2Ev3Gtdqu3sm6yH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline This problem seems to have been reported and fixed upstream: https://github.com/quodlibet/quodlibet/commit/5f55431a28509fd4f4f7b40dc246f3d34fa8549e Since no newer release has been out, I guess we can backport the commit itself. I've tried with the attached patch. The operon tests still fail due to some weird utime magic, a problem also known and discussed at: https://github.com/quodlibet/quodlibet/pull/4053/commits/06a32b319f065550efe0d2a9ff10ca6bdc32b893 So I guess we could backport that as well. Does anyone have a better fix ? --MP_/7fctDqT/2Ev3Gtdqu3sm6yH Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-quodlibet-Fix-glob-failure-in-quodlibet-tests.patch >From 7e1eb6cd1c15923c7eb64b06afac9f83f6b6cfb3 Mon Sep 17 00:00:00 2001 Message-Id: <7e1eb6cd1c15923c7eb64b06afac9f83f6b6cfb3.1683293409.git.alice.brenon@ens-lyon.fr> From: Alice BRENON Date: Fri, 5 May 2023 15:26:37 +0200 Subject: [PATCH] gnu: quodlibet: Fix glob failure in quodlibet tests. Reported in #63205. * gnu/packages/music.scm (quodlibet): Backport patch 5f55431 from upstream and reactivate passing tests. --- gnu/packages/music.scm | 6 +- .../patches/quodlibet-fix-invalid-glob.patch | 89 +++++++++++++++++++ 2 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/quodlibet-fix-invalid-glob.patch diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 446580dc52..3a005b2848 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -7082,6 +7082,8 @@ (define-public quodlibet (url "https://github.com/quodlibet/quodlibet") (commit (string-append "release-" version)))) (file-name (git-file-name name version)) + (patches (search-patches + "quodlibet-fix-invalid-glob.patch")) (sha256 (base32 "1i5k93k3bfp7hpcwkbr865mbj9jam3jv2a5k1bazcyp4f5vdrb0v")))) (build-system python-build-system) @@ -7105,9 +7107,7 @@ (define-public quodlibet "--ignore=tests/test_browsers_iradio.py" ;; broken upstream "--disable-warnings" - "--ignore=tests/quality" - ;; missing legacy icons in adwaita-icon-theme - "--ignore=tests/plugin/test_trayicon.py") + "--ignore=tests/quality/test_flake8.py") (format #t "test suite not run~%")))) (add-after 'install 'glib-or-gtk-wrap ; ensure icons loaded (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) diff --git a/gnu/packages/patches/quodlibet-fix-invalid-glob.patch b/gnu/packages/patches/quodlibet-fix-invalid-glob.patch new file mode 100644 index 0000000000..95f95d8aab --- /dev/null +++ b/gnu/packages/patches/quodlibet-fix-invalid-glob.patch @@ -0,0 +1,89 @@ +From 5f55431a28509fd4f4f7b40dc246f3d34fa8549e Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 26 Jun 2022 23:14:28 +0200 +Subject: [PATCH] builtin cover: fix handling of invalid glob ranges with + Python 3.10.5+ (#4027) + +Previously Python would raise if an invalid range was given +to glob, but with 3.10.5 they fixed it to not match anything. +https://github.com/python/cpython/issues/89973 + +Our tests depended on the previous logic and treating the glob pattern +as a literal file name in that case. + +One could argue that this is wrong since a range that doesn't contain anything +should also not match anything, so wrap glob() to make it not match for all +Python versions in that case and adjust the tests accordingly. + +This should fix the Windows CI, which is currently the only job using 3.10.5 +--- + quodlibet/util/cover/built_in.py | 22 +++++++++++----------- + tests/test_util_cover.py | 12 +++--------- + 2 files changed, 14 insertions(+), 20 deletions(-) + +diff --git a/quodlibet/util/cover/built_in.py b/quodlibet/util/cover/built_in.py +index f2a8791a2..01474c9b6 100644 +--- a/quodlibet/util/cover/built_in.py ++++ b/quodlibet/util/cover/built_in.py +@@ -100,6 +100,15 @@ class FilesystemCover(CoverSourcePlugin): + base = self.song('~dirname') + images = [] + ++ def safe_glob(*args, **kwargs): ++ try: ++ return glob.glob(*args, **kwargs) ++ except sre_constants.error: ++ # https://github.com/python/cpython/issues/89973 ++ # old glob would fail with invalid ranges, newer one ++ # handles it correctly. ++ return [] ++ + if config.getboolean("albumart", "force_filename"): + score = 100 + for filename in config.get("albumart", "filename").split(","): +@@ -107,17 +116,8 @@ class FilesystemCover(CoverSourcePlugin): + filename = filename.strip() + + escaped_path = os.path.join(glob.escape(base), filename) +- try: +- for path in glob.glob(escaped_path): +- images.append((score, path)) +- except sre_constants.error: +- # Use literal filename if globbing causes errors +- path = os.path.join(base, filename) +- +- # We check this here, so we can search for alternative +- # files in case no preferred file was found. +- if os.path.isfile(path): +- images.append((score, path)) ++ for path in safe_glob(escaped_path): ++ images.append((score, path)) + + # So names and patterns at the start are preferred + score -= 1 +diff --git a/tests/test_util_cover.py b/tests/test_util_cover.py +index db81e4d1f..71a48ad9a 100644 +--- a/tests/test_util_cover.py ++++ b/tests/test_util_cover.py +@@ -105,15 +105,9 @@ class TCoverManager(TestCase): + config.set("albumart", "force_filename", str(True)) + config.set("albumart", "filename", "[a-2].jpg") + +- # Should match +- f = self.add_file("[a-2].jpg") +- assert path_equal( +- os.path.abspath(self._find_cover(self.song).name), f) +- +- # Should not crash +- f = self.add_file("test.jpg") +- assert not path_equal( +- os.path.abspath(self._find_cover(self.song).name), f) ++ # Invalid glob range, should not match anything ++ self.add_file("a.jpg") ++ assert self._find_cover(self.song) is None + + def test_invalid_glob_path(self): + config.set("albumart", "force_filename", str(True)) +-- +2.39.2 + base-commit: 3efdc84bbd1819aeef6e2290aaf54bc88ba72dda -- 2.39.2 --MP_/7fctDqT/2Ev3Gtdqu3sm6yH--