From bf927cbd4f208eb215ff74247a9e2023b740eca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 16 Mar 2025 19:37:04 +0100 Subject: [PATCH] [config] fix using same key multiple times with 'apply' (#7127) --- gallery_dl/config.py | 1 + gallery_dl/version.py | 2 +- test/test_config.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery_dl/config.py b/gallery_dl/config.py index f932e3a5..92e55d3f 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -322,6 +322,7 @@ class apply(): set(path, key, value) def __exit__(self, exc_type, exc_value, traceback): + self.original.reverse() for path, key, value in self.original: if value is util.SENTINEL: unset(path, key) diff --git a/gallery_dl/version.py b/gallery_dl/version.py index 558b02ef..b2e71414 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,5 +6,5 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.29.2" +__version__ = "1.29.3-dev" __variant__ = None diff --git a/test/test_config.py b/test/test_config.py index 1d49d776..be58456e 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -168,6 +168,7 @@ class TestConfig(unittest.TestCase): options = ( (("b",) , "c", [1, 2, 3]), (("e", "f"), "g", 234), + (("e", "f"), "g", 234), ) self.assertEqual(config.get(("b",) , "c"), "text")