From 1eaa06c850a085bb1fe2f26a4efb88efa410c7fe Mon Sep 17 00:00:00 2001 From: Martin Hertz Date: Sat, 10 Aug 2024 20:08:56 +0200 Subject: [PATCH] [Packaging] Interim deluge-console Windows fix Deluge-console broke on Windows after commit d559f67, which before that was working because it's source files getting included with rest UI/plugin data copied into place. This workaround here, copies back it's source files into place, to restore old ways, until proper fix can be made. The underlying workarounded issues here is two-fold. It's not that anything is missing from the freezing, but rather that there at runtime is generated subparsers for the commands, using path_[0] (UI_PATH var in init.py, joined in console.py with rest path), so looking for files/paths not there anymore, as freezed now, and second, the use of OVERRIDES which breaks in freezed env since trying use inspect.stack()[2][4][0], and in freezed env stack[2][4] is None, and hence any mention of stack[2][4][0] breaks with 'NoneType object is not subscriptable'. In non-freezed, it returns the call-context correctly, as source code readily available here. --- packaging/win/delugewin.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/win/delugewin.spec b/packaging/win/delugewin.spec index b6b5573652..d078d5c912 100644 --- a/packaging/win/delugewin.spec +++ b/packaging/win/delugewin.spec @@ -107,6 +107,7 @@ datas += copy_metadata('twisted', recursive=True) # Copy UI/Plugin and translation files to where pyinstaller expects package_data = collect_data_files('deluge') datas += package_data +datas += [('../../deluge/ui/console', 'deluge/ui/console')] icon = [src for src, dest in package_data if src.endswith('deluge.ico')][0]