From 8b6fffe866e8dbf512fcb0ee0ad4c53b70cb0e5b Mon Sep 17 00:00:00 2001 From: cenodis <57576911+cenodis@users.noreply.github.com> Date: Sun, 27 Jul 2025 09:41:27 +0200 Subject: [PATCH] [pp:exec] use 'False' as default for 'start_new_session' to avoid TypeError (#7899) in Python <= 3.11 * Use False as default instead of None to avoid TypeError * Update postprocessor tests --- gallery_dl/postprocessor/exec.py | 2 +- test/test_postprocessor.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gallery_dl/postprocessor/exec.py b/gallery_dl/postprocessor/exec.py index 55fdd1ac..0bfe1a2f 100644 --- a/gallery_dl/postprocessor/exec.py +++ b/gallery_dl/postprocessor/exec.py @@ -35,7 +35,7 @@ class ExecPP(PostProcessor): if options.get("async", False): self._exec = self._popen - self.session = None + self.session = False self.creationflags = 0 if options.get("session"): if util.WINDOWS: diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index d6724b23..2e39cc7f 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -211,7 +211,7 @@ class ExecTest(BasePostprocessorTest): self.pathfmt.filename), shell=True, creationflags=0, - start_new_session=None, + start_new_session=False, ) i.wait.assert_called_once_with() @@ -235,7 +235,7 @@ class ExecTest(BasePostprocessorTest): ], shell=False, creationflags=0, - start_new_session=None, + start_new_session=False, ) def test_command_many(self): @@ -260,7 +260,7 @@ class ExecTest(BasePostprocessorTest): self.pathfmt.filename), shell=True, creationflags=0, - start_new_session=None, + start_new_session=False, ), call( [ @@ -270,7 +270,7 @@ class ExecTest(BasePostprocessorTest): ], shell=False, creationflags=0, - start_new_session=None, + start_new_session=False, ), ])